Disable Generational CC collection with non-Baker read barriers.

The current implementation of the Sticky-Bit CC collector is only
compatible with Baker read barriers. Disable it for other read barrier
types (in particular, table-lookup read barriers).

Test: ART_USE_GENERATIONAL_CC=true art/test.py
Test: ART_USE_GENERATIONAL_CC=true ART_READ_BARRIER_TYPE=TABLELOOKUP art/test.py
Bug: 67628039
Bug: 12687968
Change-Id: I6740de047545230397b65c21faf7738ad7124f8f
diff --git a/libartbase/base/globals.h b/libartbase/base/globals.h
index bc79ff2..2a2a737 100644
--- a/libartbase/base/globals.h
+++ b/libartbase/base/globals.h
@@ -123,9 +123,12 @@
 // True if we allow moving classes.
 static constexpr bool kMovingClasses = !kMarkCompactSupport;
 // If true, enable generational collection when using the Concurrent Copying
-// collector, i.e. use sticky-bit CC for minor collections and (full) CC for
-// major collections.
-#ifdef ART_USE_GENERATIONAL_CC
+// (CC) collector, i.e. use sticky-bit CC for minor collections and (full) CC
+// for major collections.
+//
+// Generational CC collection is currently only compatible with Baker read
+// barriers.
+#if defined(ART_USE_GENERATIONAL_CC) && defined(ART_READ_BARRIER_TYPE_IS_BAKER)
 static constexpr bool kEnableGenerationalConcurrentCopyingCollection = true;
 #else
 static constexpr bool kEnableGenerationalConcurrentCopyingCollection = false;