Mod-union table implementation: reference caching
Implementation which uses a map of card pointers to reference array to keep track of image space references to the alloc space.
Speed/memory usage improvements over bitmap implementation. Approximated memory usage is ~4 * number_references compared to the previous 128k due a bitmap spanning the zygote space.
For the system server, memory usage is approximately 100k due to ~20000 references to the alloc space.
Performance increases since we no longer scan objects in the imagespace when we mark the references of the mod union table.
Change-Id: I449b8b3edeba712a535f6a3b14d81743bcd6f5a0
diff --git a/src/mark_sweep.h b/src/mark_sweep.h
index 28a5523..5f275a4 100644
--- a/src/mark_sweep.h
+++ b/src/mark_sweep.h
@@ -274,12 +274,15 @@
size_t array_count_;
size_t other_count_;
+ friend class AddIfReachesAllocSpaceVisitor; // Used by mod-union table.
friend class CheckObjectVisitor;
friend class InternTableEntryIsUnmarked;
friend class MarkIfReachesAllocspaceVisitor;
friend class ModUnionClearCardVisitor;
+ friend class ModUnionReferenceVisitor;
friend class ModUnionVisitor;
friend class ModUnionTableBitmap;
+ friend class ModUnionTableReferenceCache;
DISALLOW_COPY_AND_ASSIGN(MarkSweep);
};