summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc34
1 files changed, 8 insertions, 26 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index e531091fe6..9dddf2f18f 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1221,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);
{