OSDN Git Service

Make it possible to change the read barrier type as build config.
authorHiroshi Yamauchi <yamauchi@google.com>
Fri, 2 Oct 2015 20:41:34 +0000 (13:41 -0700)
committerHiroshi Yamauchi <yamauchi@google.com>
Fri, 2 Oct 2015 20:41:34 +0000 (13:41 -0700)
Bug: 12687968
Change-Id: Ib43dab4d4e68a5a962347fcc2163c3100cb5b760

build/Android.common_build.mk
runtime/read_barrier_c.h

index 288bddd..b507124 100644 (file)
@@ -300,9 +300,17 @@ ifeq ($(ART_HEAP_POISONING),true)
   art_asflags += -DART_HEAP_POISONING=1
 endif
 
+#
+# Used to change the read barrier type. Valid values are BAKER, BROOKS, TABLELOOKUP.
+# The default is BAKER.
+#
+ART_READ_BARRIER_TYPE ?= BAKER
+
 ifeq ($(ART_USE_READ_BARRIER),true)
   art_cflags += -DART_USE_READ_BARRIER=1
+  art_cflags += -DART_READ_BARRIER_TYPE_IS_$(ART_READ_BARRIER_TYPE)=1
   art_asflags += -DART_USE_READ_BARRIER=1
+  art_asflags += -DART_READ_BARRIER_TYPE_IS_$(ART_READ_BARRIER_TYPE)=1
 endif
 
 ifeq ($(ART_USE_TLAB),true)
@@ -392,7 +400,6 @@ art_debug_cflags :=
 art_non_debug_cflags :=
 art_host_non_debug_cflags :=
 art_target_non_debug_cflags :=
-art_default_gc_type :=
 art_default_gc_type_cflags :=
 
 ART_HOST_LDLIBS :=
index 710c21f..8e5b187 100644 (file)
 // table-lookup read barriers.
 
 #ifdef ART_USE_READ_BARRIER
+#if ART_READ_BARRIER_TYPE_IS_BAKER
 #define USE_BAKER_READ_BARRIER
-// #define USE_BROOKS_READ_BARRIER
-// #define USE_TABLE_LOOKUP_READ_BARRIER
+#elif ART_READ_BARRIER_TYPE_IS_BROOKS
+#define USE_BROOKS_READ_BARRIER
+#elif ART_READ_BARRIER_TYPE_IS_TABLELOOKUP
+#define USE_TABLE_LOOKUP_READ_BARRIER
+#else
+#error "ART read barrier type must be set"
 #endif
+#endif  // ART_USE_READ_BARRIER
 
 #ifdef ART_HEAP_POISONING
 #define USE_HEAP_POISONING