Concurrent class linker and intern table root marking
We now mark the class linker and intern table roots concurrently
(with mutators unpaused), only re-marking these roots in the second pause if
they get dirtied.
Reduces root marking time by ~1ms for each pause.
Change-Id: I833fc557bac9a2930868db715587318293fa4655
diff --git a/src/runtime.h b/src/runtime.h
index a6c662c..44823a0 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -224,9 +224,20 @@
return "2.0.0";
}
- void VisitRoots(Heap::RootVisitor* visitor, void* arg) const
+ // Force all the roots which can be marked concurrently to be dirty.
+ void DirtyRoots();
+
+ // Visit all the roots.
+ void VisitRoots(Heap::RootVisitor* visitor, void* arg)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ // Visit all of the roots we can do safely do concurrently.
+ void VisitConcurrentRoots(Heap::RootVisitor* visitor, void* arg);
+
+ // Visit all other roots which must be done with mutators suspended.
+ void VisitNonConcurrentRoots(Heap::RootVisitor* visitor, void* arg)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
bool HasJniDlsymLookupStub() const {
return jni_stub_array_ != NULL;
}