summaryrefslogtreecommitdiffstats
path: root/runtime/globals.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-06-10 11:22:31 -0700
committerMathieu Chartier <mathieuc@google.com>2014-06-19 12:57:05 -0700
commit52e4b43d62896b56f8c2bd041e528472bb4a0d8d (patch)
tree3a9367c391418c1375a6c86f678b3f047cacc03f /runtime/globals.h
parentef38670cae8462d579da983c1863f96717cccee6 (diff)
downloadart-52e4b43d62896b56f8c2bd041e528472bb4a0d8d.zip
art-52e4b43d62896b56f8c2bd041e528472bb4a0d8d.tar.gz
art-52e4b43d62896b56f8c2bd041e528472bb4a0d8d.tar.bz2
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/globals.h')
-rw-r--r--runtime/globals.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/globals.h b/runtime/globals.h
index 58c2118..3a906f1 100644
--- a/runtime/globals.h
+++ b/runtime/globals.h
@@ -74,8 +74,11 @@ static constexpr bool kUsePortableCompiler = false;
// Garbage collector constants.
static constexpr bool kMovingCollector = true && !kUsePortableCompiler;
+static constexpr bool kMarkCompactSupport = false && kMovingCollector;
+// True if we allow moving field arrays, this can cause complication with mark compact.
+static constexpr bool kMoveFieldArrays = !kMarkCompactSupport;
// True if we allow moving classes.
-static constexpr bool kMovingClasses = true;
+static constexpr bool kMovingClasses = !kMarkCompactSupport;
// True if we allow moving fields.
static constexpr bool kMovingFields = false;
// True if we allow moving methods.