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/gc/mark_sweep.cc b/src/gc/mark_sweep.cc
index 03bbb6a..e4cb4d6 100644
--- a/src/gc/mark_sweep.cc
+++ b/src/gc/mark_sweep.cc
@@ -79,6 +79,8 @@
FindDefaultMarkBitmap();
// TODO: if concurrent, enable card marking in compiler
// TODO: check that the mark bitmap is entirely clear.
+ // Mark any concurrent roots as dirty since we need to scan them at least once during this GC.
+ Runtime::Current()->DirtyRoots();
}
void MarkSweep::FindDefaultMarkBitmap() {
@@ -195,7 +197,11 @@
// Marks all objects in the root set.
void MarkSweep::MarkRoots() {
- Runtime::Current()->VisitRoots(MarkObjectVisitor, this);
+ Runtime::Current()->VisitNonConcurrentRoots(MarkObjectVisitor, this);
+}
+
+void MarkSweep::MarkConcurrentRoots() {
+ Runtime::Current()->VisitConcurrentRoots(MarkObjectVisitor, this);
}
class CheckObjectVisitor {