summaryrefslogtreecommitdiff
path: root/runtime/gc/reference_processor.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2014-06-10 11:22:31 -0700
committer Mathieu Chartier <mathieuc@google.com> 2014-06-19 12:57:05 -0700
commit52e4b43d62896b56f8c2bd041e528472bb4a0d8d (patch)
tree3a9367c391418c1375a6c86f678b3f047cacc03f /runtime/gc/reference_processor.cc
parentef38670cae8462d579da983c1863f96717cccee6 (diff)
Add mark compact collector.
The mark compact collector is a 4 phase collection, doing a normal full mark_sweep, calculating forwarding addresses of objects in the from space, updating references of objects in the from space, and moving the objects in the from space. Support is diabled by default since it needs to have non movable classes and field arrays. Performance numbers is around 50% as fast. The main advantage that this has over semispace is that the worst case memory usage is 50% since we only need one space isntead of two. TODO: Make field arrays and classes movable. This causes complication since Object::VisitReferences relies on these, so if we update the fields of an object but another future object uses this object to figure out what fields are reference fields it doesn't work. Bug: 14059466 Change-Id: I661ed3b71ad4dde124ef80312c95696b4a5665a1
Diffstat (limited to 'runtime/gc/reference_processor.cc')
-rw-r--r--runtime/gc/reference_processor.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc
index 3ff9889e3c..292781e6e7 100644
--- a/runtime/gc/reference_processor.cc
+++ b/runtime/gc/reference_processor.cc
@@ -205,6 +205,10 @@ void ReferenceProcessor::DelayReferenceReferent(mirror::Class* klass, mirror::Re
}
}
+void ReferenceProcessor::UpdateRoots(IsMarkedCallback* callback, void* arg) {
+ cleared_references_.UpdateRoots(callback, arg);
+}
+
void ReferenceProcessor::EnqueueClearedReferences(Thread* self) {
Locks::mutator_lock_->AssertNotHeld(self);
if (!cleared_references_.IsEmpty()) {