Change root visitor to use Object**.
Simplifies code and improves the performance of root visiting since
we usually don't need to check to see if the object moved.
Change-Id: Iba998f5a15ae1fa1b53ca5226dd2168a411196cf
diff --git a/runtime/throw_location.cc b/runtime/throw_location.cc
index 2a1faff..06b6e8d 100644
--- a/runtime/throw_location.cc
+++ b/runtime/throw_location.cc
@@ -35,11 +35,11 @@
void ThrowLocation::VisitRoots(RootCallback* visitor, void* arg) {
if (this_object_ != nullptr) {
- this_object_ = visitor(this_object_, arg, 0, kRootVMInternal);
+ visitor(&this_object_, arg, 0, kRootVMInternal);
DCHECK(this_object_ != nullptr);
}
if (method_ != nullptr) {
- method_ = down_cast<mirror::ArtMethod*>(visitor(method_, arg, 0, kRootVMInternal));
+ visitor(reinterpret_cast<mirror::Object**>(&method_), arg, 0, kRootVMInternal);
DCHECK(method_ != nullptr);
}
}