Merge "Use r8/d8 optimized profile for dexpreopt" into main am: 8723705fad
am: b18a30edde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3095860 Change-Id: I67a2cc8d84fd930a20f6113a302f604eb53fa3f6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
14
java/base.go
14
java/base.go
@@ -1650,11 +1650,23 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
|
||||
classesJar: implementationAndResourcesJar,
|
||||
jarName: jarName,
|
||||
}
|
||||
dexOutputFile = j.dexer.compileDex(ctx, params)
|
||||
if j.EnableProfileRewriting() {
|
||||
profile := j.GetProfile()
|
||||
if profile == "" || !j.GetProfileGuided() {
|
||||
ctx.PropertyErrorf("enable_profile_rewriting", "Profile and Profile_guided must be set when enable_profile_rewriting is true")
|
||||
}
|
||||
params.artProfileInput = &profile
|
||||
}
|
||||
dexOutputFile, dexArtProfileOutput := j.dexer.compileDex(ctx, params)
|
||||
if ctx.Failed() {
|
||||
return
|
||||
}
|
||||
|
||||
// If r8/d8 provides a profile that matches the optimized dex, use that for dexpreopt.
|
||||
if dexArtProfileOutput != nil {
|
||||
j.dexpreopter.SetRewrittenProfile(*dexArtProfileOutput)
|
||||
}
|
||||
|
||||
// merge dex jar with resources if necessary
|
||||
if j.resourceJar != nil {
|
||||
jars := android.Paths{dexOutputFile, j.resourceJar}
|
||||
|
Reference in New Issue
Block a user