OSDN Git Service

Make it possible to enable tlab with a build parameter.
authorHiroshi Yamauchi <yamauchi@google.com>
Fri, 20 Mar 2015 17:28:34 +0000 (10:28 -0700)
committerHiroshi Yamauchi <yamauchi@google.com>
Fri, 20 Mar 2015 17:28:34 +0000 (10:28 -0700)
For testing.

Change-Id: I4d06a4db733b7fa09105f068028483cf88db7925

build/Android.common_build.mk
runtime/globals.h
runtime/runtime_options.def

index 08b4ec2..8f00298 100644 (file)
@@ -219,6 +219,10 @@ ifeq ($(ART_USE_READ_BARRIER),true)
   art_cflags += -DART_USE_READ_BARRIER=1
 endif
 
+ifeq ($(ART_USE_TLAB),true)
+  art_cflags += -DART_USE_TLAB=1
+endif
+
 # Cflags for non-debug ART and ART tools.
 art_non_debug_cflags := \
   -O3
index 0845475..ac8751c 100644 (file)
@@ -109,6 +109,13 @@ static constexpr bool kPoisonHeapReferences = true;
 static constexpr bool kPoisonHeapReferences = false;
 #endif
 
+// If true, enable the tlab allocator by default.
+#ifdef ART_USE_TLAB
+static constexpr bool kUseTlab = true;
+#else
+static constexpr bool kUseTlab = false;
+#endif
+
 // Kinds of tracing clocks.
 enum class TraceClockSource {
   kThreadCpu,
index 8775f8d..895ab5c 100644 (file)
@@ -62,7 +62,7 @@ RUNTIME_OPTIONS_KEY (Unit,                DumpGCPerformanceOnShutdown)
 RUNTIME_OPTIONS_KEY (Unit,                DumpJITInfoOnShutdown)
 RUNTIME_OPTIONS_KEY (Unit,                IgnoreMaxFootprint)
 RUNTIME_OPTIONS_KEY (Unit,                LowMemoryMode)
-RUNTIME_OPTIONS_KEY (bool,                UseTLAB,                        false)
+RUNTIME_OPTIONS_KEY (bool,                UseTLAB,                        kUseTlab)
 RUNTIME_OPTIONS_KEY (bool,                EnableHSpaceCompactForOOM,      true)
 RUNTIME_OPTIONS_KEY (bool,                UseJIT,      false)
 RUNTIME_OPTIONS_KEY (unsigned int,        JITCompileThreshold, jit::Jit::kDefaultCompileThreshold)