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

Commit 22217f6a authored by David Brazdil's avatar David Brazdil
Browse files

Revert "[framework] Compile secondary dex files in isolation"

This reverts commit 8a5a708d.
ART does not compile secondary dex files in the user process
any more. The original issue of a large overhead of providing
a class loader context is therefore not relevant any more and
we can start passing the context to installd.

Note that this also partially reverts commit
6dba50d6 which restricted
visibility of methods in PackageDexUsage. The commit also
removed data collection for unsupported class loaders. The
logic in PackageDexOptimizer was adjusted accordingly.

Bug: 64530081
Bug: 111174995
Test: manual
Change-Id: Id78b5a6d8841b199c12a63a8d45d12efbcc32275
parent 3176e8be
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -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()) {
+2 −4
Original line number Diff line number Diff line
@@ -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);
        }
    }