aboutsummaryrefslogtreecommitdiff
path: root/dexpreopt
diff options
context:
space:
mode:
authorJiakai Zhang <jiakaiz@google.com>2022-11-16 11:50:59 +0000
committerJiakai Zhang <jiakaiz@google.com>2022-11-16 12:04:53 +0000
commit616be0695e93c6150470c8b9ca5e1bd372de1d5b (patch)
treed2e4d3c236853975d6f7d021b290461ce724764f /dexpreopt
parented9729727c837e375e3a5957bc2c985dc81f90b3 (diff)
Pass "-Xgc:CMC" to dex2oat when userfaultfd GC is enabled.
This change is a no-op change. It doesn't enable userfaultfd GC by default. ENABLE_UFFD_GC=true can be passed to the build system to enable userfaultfd GC for testing purposes. Bug: 242553398 Test: - 1. lunch aosp_oriole-userdebug 2. ENABLE_UFFD_GC=true m 3. See "--runtime-arg -Xgc:CMC" in .invocation files. Change-Id: I789b49a71b9604fd41bf1ef77d0ac5bac4cbdf25
Diffstat (limited to 'dexpreopt')
-rw-r--r--dexpreopt/config.go2
-rw-r--r--dexpreopt/dexpreopt.go4
2 files changed, 6 insertions, 0 deletions
diff --git a/dexpreopt/config.go b/dexpreopt/config.go
index eefda197c..609a29c2d 100644
--- a/dexpreopt/config.go
+++ b/dexpreopt/config.go
@@ -96,6 +96,8 @@ type GlobalConfig struct {
// quickly silence build errors. This flag should be used with caution and only as a temporary
// measure, as it masks real errors and affects performance.
RelaxUsesLibraryCheck bool
+
+ EnableUffdGc bool // preopt with the assumption that userfaultfd GC will be used on device.
}
var allPlatformSystemServerJarsKey = android.NewOnceKey("allPlatformSystemServerJars")
diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go
index fdfd22e1b..e3404a541 100644
--- a/dexpreopt/dexpreopt.go
+++ b/dexpreopt/dexpreopt.go
@@ -495,6 +495,10 @@ func dexpreoptCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig, g
cmd.FlagWithInput("--profile-file=", profile)
}
+ if global.EnableUffdGc {
+ cmd.Flag("--runtime-arg").Flag("-Xgc:CMC")
+ }
+
rule.Install(odexPath, odexInstallPath)
rule.Install(vdexPath, vdexInstallPath)
}