Merge "Propagate profile_guided requirement of imports to top-level apex" into main
This commit is contained in:
@@ -1105,6 +1105,10 @@ func (module *PrebuiltBootclasspathFragmentModule) RequiredFilesFromPrebuiltApex
|
||||
return nil
|
||||
}
|
||||
|
||||
func (module *PrebuiltBootclasspathFragmentModule) UseProfileGuidedDexpreopt() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
var _ android.RequiredFilesFromPrebuiltApex = (*PrebuiltBootclasspathFragmentModule)(nil)
|
||||
|
||||
func prebuiltBootclasspathFragmentFactory() android.Module {
|
||||
|
@@ -282,6 +282,17 @@ func (d *Dexpreopter) DexpreoptPrebuiltApexSystemServerJars(ctx android.ModuleCo
|
||||
d.installPath = android.PathForModuleInPartitionInstall(ctx, "", strings.TrimPrefix(dexpreopt.GetSystemServerDexLocation(ctx, dc, libraryName), "/"))
|
||||
// generate the rules for creating the .odex and .vdex files for this system server jar
|
||||
dexJarFile := di.PrebuiltExportPath(ApexRootRelativePathToJavaLib(libraryName))
|
||||
|
||||
d.inputProfilePathOnHost = nil // reset: TODO(spandandas): Make dexpreopter stateless
|
||||
if android.InList(libraryName, di.GetDexpreoptProfileGuidedExportedModuleNames()) {
|
||||
// Set the profile path to guide optimization
|
||||
prof := di.PrebuiltExportPath(ApexRootRelativePathToJavaLib(libraryName) + ".prof")
|
||||
if prof == nil {
|
||||
ctx.ModuleErrorf("Could not find a .prof file in this prebuilt apex")
|
||||
}
|
||||
d.inputProfilePathOnHost = prof
|
||||
}
|
||||
|
||||
d.dexpreopt(ctx, libraryName, dexJarFile)
|
||||
}
|
||||
|
||||
@@ -354,6 +365,7 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, libName string, dexJa
|
||||
var profileClassListing android.OptionalPath
|
||||
var profileBootListing android.OptionalPath
|
||||
profileIsTextListing := false
|
||||
|
||||
if d.inputProfilePathOnHost != nil {
|
||||
profileClassListing = android.OptionalPathForPath(d.inputProfilePathOnHost)
|
||||
} else if BoolDefault(d.dexpreoptProperties.Dex_preopt.Profile_guided, true) && !forPrebuiltApex(ctx) {
|
||||
|
@@ -2463,6 +2463,10 @@ func (j *Import) RequiredFilesFromPrebuiltApex(_ android.BaseModuleContext) []st
|
||||
return requiredFilesFromPrebuiltApexForImport(name, &j.dexpreopter)
|
||||
}
|
||||
|
||||
func (j *Import) UseProfileGuidedDexpreopt() bool {
|
||||
return proptools.Bool(j.importDexpreoptProperties.Dex_preopt.Profile_guided)
|
||||
}
|
||||
|
||||
// Add compile time check for interface implementation
|
||||
var _ android.IDEInfo = (*Import)(nil)
|
||||
var _ android.IDECustomizedModuleName = (*Import)(nil)
|
||||
|
@@ -3019,6 +3019,10 @@ func (module *SdkLibraryImport) RequiredFilesFromPrebuiltApex(ctx android.BaseMo
|
||||
return requiredFilesFromPrebuiltApexForImport(name, &module.dexpreopter)
|
||||
}
|
||||
|
||||
func (j *SdkLibraryImport) UseProfileGuidedDexpreopt() bool {
|
||||
return proptools.Bool(j.importDexpreoptProperties.Dex_preopt.Profile_guided)
|
||||
}
|
||||
|
||||
// java_sdk_library_xml
|
||||
type sdkLibraryXml struct {
|
||||
android.ModuleBase
|
||||
|
@@ -313,6 +313,10 @@ func (module *prebuiltSystemServerClasspathModule) RequiredFilesFromPrebuiltApex
|
||||
return nil
|
||||
}
|
||||
|
||||
func (module *prebuiltSystemServerClasspathModule) UseProfileGuidedDexpreopt() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
var _ android.RequiredFilesFromPrebuiltApex = (*prebuiltSystemServerClasspathModule)(nil)
|
||||
|
||||
func prebuiltSystemServerClasspathModuleFactory() android.Module {
|
||||
|
Reference in New Issue
Block a user