diff options
Diffstat (limited to 'runtime/runtime.cc')
| -rw-r--r-- | runtime/runtime.cc | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index fabbbfb9ed..9dddf2f18f 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -40,6 +40,8 @@ #include "arch/instruction_set_features.h" #include "arch/mips/quick_method_frame_info_mips.h" #include "arch/mips/registers_mips.h" +#include "arch/mips64/quick_method_frame_info_mips64.h" +#include "arch/mips64/registers_mips64.h" #include "arch/x86/quick_method_frame_info_x86.h" #include "arch/x86/registers_x86.h" #include "arch/x86_64/quick_method_frame_info_x86_64.h" @@ -1219,33 +1221,15 @@ void Runtime::VisitConcurrentRoots(RootCallback* callback, void* arg, VisitRootF void Runtime::VisitNonThreadRoots(RootCallback* callback, void* arg) { java_vm_->VisitRoots(callback, arg); - if (!sentinel_.IsNull()) { - sentinel_.VisitRoot(callback, arg, 0, kRootVMInternal); - DCHECK(!sentinel_.IsNull()); - } - if (!pre_allocated_OutOfMemoryError_.IsNull()) { - pre_allocated_OutOfMemoryError_.VisitRoot(callback, arg, 0, kRootVMInternal); - DCHECK(!pre_allocated_OutOfMemoryError_.IsNull()); - } - resolution_method_.VisitRoot(callback, arg, 0, kRootVMInternal); - DCHECK(!resolution_method_.IsNull()); - if (!pre_allocated_NoClassDefFoundError_.IsNull()) { - pre_allocated_NoClassDefFoundError_.VisitRoot(callback, arg, 0, kRootVMInternal); - DCHECK(!pre_allocated_NoClassDefFoundError_.IsNull()); - } - if (HasImtConflictMethod()) { - imt_conflict_method_.VisitRoot(callback, arg, 0, kRootVMInternal); - } - if (!imt_unimplemented_method_.IsNull()) { - imt_unimplemented_method_.VisitRoot(callback, arg, 0, kRootVMInternal); - } - if (HasDefaultImt()) { - default_imt_.VisitRoot(callback, arg, 0, kRootVMInternal); - } + sentinel_.VisitRootIfNonNull(callback, arg, RootInfo(kRootVMInternal)); + pre_allocated_OutOfMemoryError_.VisitRootIfNonNull(callback, arg, RootInfo(kRootVMInternal)); + resolution_method_.VisitRoot(callback, arg, RootInfo(kRootVMInternal)); + pre_allocated_NoClassDefFoundError_.VisitRootIfNonNull(callback, arg, RootInfo(kRootVMInternal)); + imt_conflict_method_.VisitRootIfNonNull(callback, arg, RootInfo(kRootVMInternal)); + imt_unimplemented_method_.VisitRootIfNonNull(callback, arg, RootInfo(kRootVMInternal)); + default_imt_.VisitRootIfNonNull(callback, arg, RootInfo(kRootVMInternal)); for (int i = 0; i < Runtime::kLastCalleeSaveType; i++) { - if (!callee_save_methods_[i].IsNull()) { - callee_save_methods_[i].VisitRoot(callback, arg, 0, kRootVMInternal); - } + callee_save_methods_[i].VisitRootIfNonNull(callback, arg, RootInfo(kRootVMInternal)); } verifier::MethodVerifier::VisitStaticRoots(callback, arg); { @@ -1356,6 +1340,11 @@ void Runtime::SetInstructionSet(InstructionSet instruction_set) { CalleeSaveType type = static_cast<CalleeSaveType>(i); callee_save_method_frame_infos_[i] = mips::MipsCalleeSaveMethodFrameInfo(type); } + } else if (instruction_set_ == kMips64) { + for (int i = 0; i != kLastCalleeSaveType; ++i) { + CalleeSaveType type = static_cast<CalleeSaveType>(i); + callee_save_method_frame_infos_[i] = mips64::Mips64CalleeSaveMethodFrameInfo(type); + } } else if (instruction_set_ == kX86) { for (int i = 0; i != kLastCalleeSaveType; ++i) { CalleeSaveType type = static_cast<CalleeSaveType>(i); |