Enable mod union table

Enable mod union table(bitmap). This change aims to reduce the second pause times by processing dirty image cards and cleaning them by storing their alloc space references in a bitmap. The bitmap is then scanned concurrently(if CMS) before recursive mark.

Reduces second pause time. Second pause time now typically < 5 ms instead of 30-40ms.

Change-Id: I831eeb8af7299d4e86cf2dd9c29d0b7e230cd387
diff --git a/src/heap.h b/src/heap.h
index 23053f5..b91868c 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -37,13 +37,14 @@
 class HeapBitmap;
 class ImageSpace;
 class MarkStack;
+class ModUnionTable;
+class ModUnionTableBitmap;
 class Object;
 class Space;
 class SpaceTest;
 class Thread;
 
 class LOCKABLE Heap {
-  friend class ScopedHeapLock;
  public:
   static const size_t kInitialSize = 2 * MB;
 
@@ -287,6 +288,10 @@
 
   HeapBitmap* live_bitmap_;
 
+  // TODO: Reduce memory usage, this bitmap currently takes 1 bit per 8 bytes
+  // of image space.
+  ModUnionTable* mod_union_table_;
+
   CardTable* card_table_;
 
   // Used by the image writer to disable card marking on copied objects
@@ -341,6 +346,7 @@
 
   bool verify_objects_;
 
+  friend class ScopedHeapLock;
   FRIEND_TEST(SpaceTest, AllocAndFree);
   FRIEND_TEST(SpaceTest, AllocAndFreeList);
   friend class SpaceTest;