Configure R8 store-store-fence constructor inlining when enabled
This optimization will be enabled when RELEASE_R8_STORE_STORE_FENCE_CONSTRUCTOR_INLINING is enabled.
Bug:
Test: Existing
Change-Id: Ia1dc0600e51e396da518daa27cf9c73701095766
diff --git a/android/config.go b/android/config.go
index d78bbf7..fbf9504 100644
--- a/android/config.go
+++ b/android/config.go
@@ -2163,6 +2163,10 @@
return c.productVariables.GetBuildFlagBool("RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH")
}
+func (c *config) UseR8StoreStoreFenceConstructorInlining() bool {
+ return c.productVariables.GetBuildFlagBool("RELEASE_R8_STORE_STORE_FENCE_CONSTRUCTOR_INLINING")
+}
+
func (c *config) UseDexV41() bool {
return c.productVariables.GetBuildFlagBool("RELEASE_USE_DEX_V41")
}
diff --git a/java/dex.go b/java/dex.go
index 2b3c931..168a231 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -412,6 +412,10 @@
artProfileOutput = profileOutput
}
+ if ctx.Config().UseR8StoreStoreFenceConstructorInlining() {
+ r8Flags = append(r8Flags, "--store-store-fence-constructor-inlining")
+ }
+
return r8Flags, r8Deps, artProfileOutput
}