Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7495af74 authored by David Brazdil's avatar David Brazdil Committed by android-build-merger
Browse files

Merge "Revert "[framework] Compile secondary dex files in isolation"" am: 2c0278d3 am: 37e38790

am: 51beefd2

Change-Id: I82ee47da2ef0dca5ec4fbfec500db29854026558
parents 9bb25943 51beefd2
Loading
Loading
Loading
Loading
+11 −6
Original line number Original line Diff line number Diff line
@@ -402,12 +402,17 @@ public class PackageDexOptimizer {
                + " dexoptFlags=" + printDexoptFlags(dexoptFlags)
                + " dexoptFlags=" + printDexoptFlags(dexoptFlags)
                + " target-filter=" + compilerFilter);
                + " target-filter=" + compilerFilter);


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

        int reason = options.getCompilationReason();
        int reason = options.getCompilationReason();
        try {
        try {
            for (String isa : dexUseInfo.getLoaderIsas()) {
            for (String isa : dexUseInfo.getLoaderIsas()) {
+2 −4
Original line number Original line Diff line number Diff line
@@ -875,15 +875,13 @@ public class PackageDexUsage extends AbstractStatsBase<Void> {


        public String getClassLoaderContext() { return mClassLoaderContext; }
        public String getClassLoaderContext() { return mClassLoaderContext; }


        @VisibleForTesting
        public boolean isUnknownClassLoaderContext() {
        /* package */ boolean isUnknownClassLoaderContext() {
            // The class loader context may be unknown if we loaded the data from a previous version
            // The class loader context may be unknown if we loaded the data from a previous version
            // which didn't save the context.
            // which didn't save the context.
            return UNKNOWN_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext);
            return UNKNOWN_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext);
        }
        }


        @VisibleForTesting
        public boolean isVariableClassLoaderContext() {
        /* package */ boolean isVariableClassLoaderContext() {
            return VARIABLE_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext);
            return VARIABLE_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext);
        }
        }
    }
    }