Improve the generational mode.

- Turn the compile-time flags for generational mode into a command
  line flag.

- In the generational mode, always collect the whole heap, as opposed
  to the bump pointer space only, if a collection is an explicit,
  native allocation-triggered or last attempt one.

Change-Id: I7a14a707cc47e6e3aa4a3292db62533409f17563
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 465ee4c..0c3db86 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -25,6 +25,7 @@
 #include "base/timing_logger.h"
 #include "gc/accounting/atomic_stack.h"
 #include "gc/accounting/card_table.h"
+#include "gc/gc_cause.h"
 #include "gc/collector/gc_type.h"
 #include "gc/collector_type.h"
 #include "globals.h"
@@ -98,18 +99,6 @@
   kAllocatorTypeLOS,  // Large object space, also doesn't have entrypoints.
 };
 
-// What caused the GC?
-enum GcCause {
-  // GC triggered by a failed allocation. Thread doing allocation is blocked waiting for GC before
-  // retrying allocation.
-  kGcCauseForAlloc,
-  // A background GC trying to ensure there is free memory ahead of allocations.
-  kGcCauseBackground,
-  // An explicit System.gc() call.
-  kGcCauseExplicit,
-};
-std::ostream& operator<<(std::ostream& os, const GcCause& policy);
-
 // How we want to sanity check the heap's correctness.
 enum HeapVerificationMode {
   kHeapVerificationNotPermitted,  // Too early in runtime start-up for heap to be verified.