Experimental Sticky-Bit (Generational) CC collection

Use the card table to quickly collect regions allocated since the
last GC. This is similar in behavior to sticky CMS.

TODO: This is using the existing sticky CMS ergonomics, we can
maybe improve on these.

Guard Generational Concurrent Copying collection with compile-time
flag art::kEnableGenerationalConcurrentCopyingCollection, set by
environment variable ART_USE_GENERATIONAL_CC.

Test: ART run-tests & gtests, libcore tests, JDWP tests (host & device)
Test: Device/emulator boot test
Bug: 67628039
Bug: 12687968
Change-Id: I9c8023b71a029b0a73527cf67d924675c4c14305
diff --git a/build/art.go b/build/art.go
index 3dabce3..61b1a4e 100644
--- a/build/art.go
+++ b/build/art.go
@@ -66,8 +66,12 @@
 			"-DART_READ_BARRIER_TYPE_IS_"+barrierType+"=1")
 	}
 
-  cdexLevel := envDefault(ctx, "ART_DEFAULT_COMPACT_DEX_LEVEL", "fast")
-  cflags = append(cflags, "-DART_DEFAULT_COMPACT_DEX_LEVEL="+cdexLevel)
+	if envTrue(ctx, "ART_USE_GENERATIONAL_CC") {
+		cflags = append(cflags, "-DART_USE_GENERATIONAL_CC=1")
+	}
+
+	cdexLevel := envDefault(ctx, "ART_DEFAULT_COMPACT_DEX_LEVEL", "fast")
+	cflags = append(cflags, "-DART_DEFAULT_COMPACT_DEX_LEVEL="+cdexLevel)
 
 	// We need larger stack overflow guards for ASAN, as the compiled code will have
 	// larger frame sizes. For simplicity, just use global not-target-specific cflags.
@@ -312,19 +316,19 @@
 		codegen(ctx, c, true)
 
 		type props struct {
-		  Target struct {
-		    Android struct {
-		      Shared_libs []string
-		    }
-		  }
+			Target struct {
+				Android struct {
+					Shared_libs []string
+				}
+			}
 		}
 
 		p := &props{}
 		// TODO: express this in .bp instead b/79671158
 		if !envTrue(ctx, "ART_TARGET_LINUX") {
-		  p.Target.Android.Shared_libs = []string {
-		    "libmetricslogger",
-		  }
+			p.Target.Android.Shared_libs = []string{
+				"libmetricslogger",
+			}
 		}
 		ctx.AppendProperties(p)
 	})