Merge "Use boot image extension in the JIT-zygote experiment."
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index 2ee5f8d..da68660 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -106,9 +106,8 @@
global := dexpreoptGlobalConfig(ctx)
bootImage := defaultBootImageConfig(ctx)
- defaultBootImage := bootImage
if global.UseApexImage {
- bootImage = apexBootImageConfig(ctx)
+ bootImage = frameworkJZBootImageConfig(ctx)
}
var archs []android.ArchType
@@ -179,11 +178,8 @@
DexPreoptImagesDeps: imagesDeps,
DexPreoptImageLocations: bootImage.imageLocations,
- // We use the dex paths and dex locations of the default boot image, as it
- // contains the full dexpreopt boot classpath. Other images may just contain a subset of
- // the dexpreopt boot classpath.
- PreoptBootClassPathDexFiles: defaultBootImage.dexPathsDeps.Paths(),
- PreoptBootClassPathDexLocations: defaultBootImage.dexLocationsDeps,
+ PreoptBootClassPathDexFiles: bootImage.dexPathsDeps.Paths(),
+ PreoptBootClassPathDexLocations: bootImage.dexLocationsDeps,
PreoptExtractedApk: false,
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index fe5bed5..66840b5 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -220,7 +220,8 @@
d.otherImages = append(d.otherImages, buildBootImage(ctx, artBootImageConfig(ctx)))
if global.GenerateApexImage {
// Create boot images for the JIT-zygote experiment.
- d.otherImages = append(d.otherImages, buildBootImage(ctx, apexBootImageConfig(ctx)))
+ d.otherImages = append(d.otherImages, buildBootImage(ctx, artJZBootImageConfig(ctx)))
+ d.otherImages = append(d.otherImages, buildBootImage(ctx, frameworkJZBootImageConfig(ctx)))
}
dumpOatRules(ctx, d.defaultBootImage)
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index a0fcba7..31bec93 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -122,10 +122,11 @@
}
var (
- bootImageConfigKey = android.NewOnceKey("bootImageConfig")
- artBootImageName = "art"
- frameworkBootImageName = "boot"
- apexBootImageName = "apex"
+ bootImageConfigKey = android.NewOnceKey("bootImageConfig")
+ artBootImageName = "art"
+ frameworkBootImageName = "boot"
+ artJZBootImageName = "jitzygote-art"
+ frameworkJZBootImageName = "jitzygote-boot"
)
// Construct the global boot image configs.
@@ -179,22 +180,33 @@
dexLocationsDeps: append(artLocations, frameworkLocations...),
}
- // Apex config for the boot image used in the JIT-zygote experiment.
- // It includes both the Core libraries and framework.
- apexCfg := bootImageConfig{
+ // ART config for JIT-zygote boot image.
+ artJZCfg := bootImageConfig{
extension: false,
- name: apexBootImageName,
+ name: artJZBootImageName,
+ stem: "apex",
+ installSubdir: artSubdir,
+ modules: artModules,
+ dexLocations: artLocations,
+ dexLocationsDeps: artLocations,
+ }
+
+ // Framework config for JIT-zygote boot image extension.
+ frameworkJZCfg := bootImageConfig{
+ extension: true,
+ name: frameworkJZBootImageName,
stem: "apex",
installSubdir: frameworkSubdir,
- modules: concat(artModules, frameworkModules),
- dexLocations: concat(artLocations, frameworkLocations),
- dexLocationsDeps: concat(artLocations, frameworkLocations),
+ modules: frameworkModules,
+ dexLocations: frameworkLocations,
+ dexLocationsDeps: append(artLocations, frameworkLocations...),
}
configs := map[string]*bootImageConfig{
- artBootImageName: &artCfg,
- frameworkBootImageName: &frameworkCfg,
- apexBootImageName: &apexCfg,
+ artBootImageName: &artCfg,
+ frameworkBootImageName: &frameworkCfg,
+ artJZBootImageName: &artJZCfg,
+ frameworkJZBootImageName: &frameworkJZCfg,
}
// common to all configs
@@ -236,6 +248,10 @@
frameworkCfg.dexPathsDeps = append(artCfg.dexPathsDeps, frameworkCfg.dexPathsDeps...)
frameworkCfg.imageLocations = append(artCfg.imageLocations, frameworkCfg.imageLocations...)
+ // specific to the jitzygote-framework config
+ frameworkJZCfg.dexPathsDeps = append(artJZCfg.dexPathsDeps, frameworkJZCfg.dexPathsDeps...)
+ frameworkJZCfg.imageLocations = append(artJZCfg.imageLocations, frameworkJZCfg.imageLocations...)
+
return configs
}).(map[string]*bootImageConfig)
}
@@ -248,8 +264,12 @@
return *genBootImageConfigs(ctx)[frameworkBootImageName]
}
-func apexBootImageConfig(ctx android.PathContext) bootImageConfig {
- return *genBootImageConfigs(ctx)[apexBootImageName]
+func artJZBootImageConfig(ctx android.PathContext) bootImageConfig {
+ return *genBootImageConfigs(ctx)[artJZBootImageName]
+}
+
+func frameworkJZBootImageConfig(ctx android.PathContext) bootImageConfig {
+ return *genBootImageConfigs(ctx)[frameworkJZBootImageName]
}
func defaultBootclasspath(ctx android.PathContext) []string {