summaryrefslogtreecommitdiff
path: root/build/art.go
diff options
context:
space:
mode:
Diffstat (limited to 'build/art.go')
-rw-r--r--build/art.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/build/art.go b/build/art.go
index c39b7e3f38..56df14239f 100644
--- a/build/art.go
+++ b/build/art.go
@@ -38,19 +38,13 @@ func globalFlags(ctx android.LoadHookContext) ([]string, []string) {
opt := ctx.Config().GetenvWithDefault("ART_NDEBUG_OPT_FLAG", "-O3")
cflags = append(cflags, opt)
- tlab := false
-
- gcType := ctx.Config().GetenvWithDefault("ART_DEFAULT_GC_TYPE", "CMS")
+ gcType := ctx.Config().GetenvWithDefault("ART_DEFAULT_GC_TYPE", "CMC")
if ctx.Config().IsEnvTrue("ART_TEST_DEBUG_GC") {
gcType = "SS"
- tlab = true
}
cflags = append(cflags, "-DART_DEFAULT_GC_TYPE_IS_"+gcType)
- if tlab {
- cflags = append(cflags, "-DART_USE_TLAB=1")
- }
if ctx.Config().IsEnvTrue("ART_HEAP_POISONING") {
cflags = append(cflags, "-DART_HEAP_POISONING=1")
@@ -70,11 +64,18 @@ func globalFlags(ctx android.LoadHookContext) ([]string, []string) {
asflags = append(asflags,
"-DART_USE_READ_BARRIER=1",
"-DART_READ_BARRIER_TYPE_IS_"+barrierType+"=1")
- }
- if !ctx.Config().IsEnvFalse("ART_USE_GENERATIONAL_CC") {
- cflags = append(cflags, "-DART_USE_GENERATIONAL_CC=1")
+ if !ctx.Config().IsEnvFalse("ART_USE_GENERATIONAL_CC") {
+ cflags = append(cflags, "-DART_USE_GENERATIONAL_CC=1")
+ }
+ // For now force CC as we don't want to make userfaultfd GC the default.
+ // Eventually, make it such that we force CC only if ART_USE_READ_BARRIER
+ // was set to true explicitly during build time.
+ cflags = append(cflags, "-DART_FORCE_USE_READ_BARRIER=1")
}
+ // The only GC which does not want ART_USE_TLAB set is CMS, which isn't actually used.
+ // When read-barrier is not set, we use userfaultfd GC.
+ cflags = append(cflags, "-DART_USE_TLAB=1")
cdexLevel := ctx.Config().GetenvWithDefault("ART_DEFAULT_COMPACT_DEX_LEVEL", "fast")
cflags = append(cflags, "-DART_DEFAULT_COMPACT_DEX_LEVEL="+cdexLevel)