Merge "Revert "[framework] Compile secondary dex files in isolation"" am: 2c0278d35f

am: 37e38790d6

Change-Id: I521d14015c2367fad26c5167b80e2ff53a3e8b8a
This commit is contained in:
David Brazdil
2018-12-20 00:47:37 -08:00
committed by android-build-merger
2 changed files with 13 additions and 10 deletions

View File

@@ -404,12 +404,17 @@ public class PackageDexOptimizer {
+ " dexoptFlags=" + printDexoptFlags(dexoptFlags)
+ " target-filter=" + compilerFilter);
// TODO(calin): b/64530081 b/66984396. Use SKIP_SHARED_LIBRARY_CHECK for the context
// (instead of dexUseInfo.getClassLoaderContext()) in order to compile secondary dex files
// in isolation (and avoid to extract/verify the main apk if it's in the class path).
// Note this trades correctness for performance since the resulting slow down is
// unacceptable in some cases until b/64530081 is fixed.
String classLoaderContext = SKIP_SHARED_LIBRARY_CHECK;
String classLoaderContext;
if (dexUseInfo.isUnknownClassLoaderContext() || dexUseInfo.isVariableClassLoaderContext()) {
// If we have an unknown (not yet set), or a variable class loader chain, compile
// without a context and mark the oat file with SKIP_SHARED_LIBRARY_CHECK. Note that
// this might lead to a incorrect compilation.
// TODO(calin): We should just extract in this case.
classLoaderContext = SKIP_SHARED_LIBRARY_CHECK;
} else {
classLoaderContext = dexUseInfo.getClassLoaderContext();
}
int reason = options.getCompilationReason();
try {
for (String isa : dexUseInfo.getLoaderIsas()) {

View File

@@ -863,15 +863,13 @@ public class PackageDexUsage extends AbstractStatsBase<Void> {
public String getClassLoaderContext() { return mClassLoaderContext; }
@VisibleForTesting
/* package */ boolean isUnknownClassLoaderContext() {
public boolean isUnknownClassLoaderContext() {
// The class loader context may be unknown if we loaded the data from a previous version
// which didn't save the context.
return UNKNOWN_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext);
}
@VisibleForTesting
/* package */ boolean isVariableClassLoaderContext() {
public boolean isVariableClassLoaderContext() {
return VARIABLE_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext);
}
}