ART: make generational CC a runtime option

Add -Xgc:[no]generational_cc option to control whether generational
Concurrent Copy collector is enabled when art is launched.

Repurpose the environment variable and preprocessor macro name
`ART_USE_GENERATIONAL_CC` to selecting the default behavior (if unset,
the default is to use Generational CC collection by default).

Test: Run art with -Xgc:[no]generational_cc along with -XX:DumpGCPerformanceOnShutdown on some benchmarks to see if minor GC runs. parsed_options_test is updated to test this new option.
Test: make test-art-host-gtest-parsed_options_test
Test: make test-art-target-gtest-parsed_options_test
Bug: 112187497
Bug: 67628039
Change-Id: I6b4660b06f7e793911a2601bed24c33777190741
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index d79793b..76c833a 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1239,6 +1239,10 @@
             kExtraDefaultHeapGrowthMultiplier;
   }
   XGcOption xgc_option = runtime_options.GetOrDefault(Opt::GcOption);
+
+  // Generational CC collection is currently only compatible with Baker read barriers.
+  bool use_generational_cc = kUseBakerReadBarrier && xgc_option.generational_cc;
+
   heap_ = new gc::Heap(runtime_options.GetOrDefault(Opt::MemoryInitialSize),
                        runtime_options.GetOrDefault(Opt::HeapGrowthLimit),
                        runtime_options.GetOrDefault(Opt::HeapMinFree),
@@ -1273,6 +1277,7 @@
                        xgc_option.gcstress_,
                        xgc_option.measure_,
                        runtime_options.GetOrDefault(Opt::EnableHSpaceCompactForOOM),
+                       use_generational_cc,
                        runtime_options.GetOrDefault(Opt::HSpaceCompactForOOMMinIntervalsMs),
                        runtime_options.Exists(Opt::DumpRegionInfoBeforeGC),
                        runtime_options.Exists(Opt::DumpRegionInfoAfterGC));