Cumulative timing logger

Added a new class: Cumulative timing logger. This logger enables us to get an average of how long each Gc phase takes.

Change-Id: I87874d4c25b5935ef30ef593a9bd36a27e45ae14
diff --git a/src/heap.h b/src/heap.h
index 104cbdf..912bfb6 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -28,6 +28,7 @@
 #include "mutex.h"
 #include "offsets.h"
 #include "safe_map.h"
+#include "timing_logger.h"
 
 #define VERIFY_OBJECT_ENABLED 0
 
@@ -52,11 +53,13 @@
 
 enum GcType {
   // Full GC
-  GC_FULL,
+  kGcTypeFull,
   // Sticky mark bits "generational" GC.
-  GC_STICKY,
-  // Partial GC, over only the alloc space
-  GC_PARTIAL,
+  kGcTypeSticky,
+  // Partial GC, over only the alloc space.
+  kGcTypePartial,
+  // Number of different Gc types.
+  kGcTypeMax,
 };
 std::ostream& operator<<(std::ostream& os, const GcType& policy);
 
@@ -329,6 +332,10 @@
   // The alloc space which we are currently allocating into.
   AllocSpace* alloc_space_;
 
+  // One cumulative logger for each type of Gc.
+  typedef SafeMap<GcType, CumulativeLogger*> CumulativeTimings;
+  CumulativeTimings cumulative_timings_;
+
   // The mod-union table remembers all of the references from the image space to the alloc /
   // zygote spaces.
   UniquePtr<ModUnionTable> mod_union_table_;