From 815873ecc312b1d231acce71e1a16f42cdaf09f2 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 13 Feb 2014 18:02:13 -0800 Subject: 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 --- runtime/runtime.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'runtime/runtime.cc') diff --git a/runtime/runtime.cc b/runtime/runtime.cc index e1b0ed4..e66e5af 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1333,26 +1333,23 @@ void Runtime::VisitNonThreadRoots(RootCallback* callback, void* arg) { mirror::PrimitiveArray::VisitRoots(callback, arg); // ShortArray java_vm_->VisitRoots(callback, arg); if (pre_allocated_OutOfMemoryError_ != nullptr) { - pre_allocated_OutOfMemoryError_ = down_cast( - callback(pre_allocated_OutOfMemoryError_, arg, 0, kRootVMInternal)); + callback(reinterpret_cast(&pre_allocated_OutOfMemoryError_), arg, 0, + kRootVMInternal); DCHECK(pre_allocated_OutOfMemoryError_ != nullptr); } - resolution_method_ = down_cast(callback(resolution_method_, arg, 0, - kRootVMInternal)); + callback(reinterpret_cast(&resolution_method_), arg, 0, kRootVMInternal); DCHECK(resolution_method_ != nullptr); if (HasImtConflictMethod()) { - imt_conflict_method_ = down_cast(callback(imt_conflict_method_, arg, 0, - kRootVMInternal)); + callback(reinterpret_cast(&imt_conflict_method_), arg, 0, kRootVMInternal); } if (HasDefaultImt()) { - default_imt_ = down_cast*>(callback(default_imt_, arg, - 0, kRootVMInternal)); + callback(reinterpret_cast(&default_imt_), arg, 0, kRootVMInternal); } for (int i = 0; i < Runtime::kLastCalleeSaveType; i++) { if (callee_save_methods_[i] != nullptr) { - callee_save_methods_[i] = down_cast( - callback(callee_save_methods_[i], arg, 0, kRootVMInternal)); + callback(reinterpret_cast(&callee_save_methods_[i]), arg, 0, + kRootVMInternal); } } { -- cgit v1.1