diff options
author | Ivan Gavrilovic <gavra@google.com> | 2017-07-14 21:29:50 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-07-14 21:29:50 +0000 |
commit | b59ea06a6314f3769dfa44328219f5709f8bb9f6 (patch) | |
tree | 0e46f083cf6dfa76bad446e38675aec3a968a706 | |
parent | 2a277aff30613ff55040c64111c1ff7ad1e26908 (diff) | |
parent | 756f069f1a34f1ba6b00d9ffca51dd5be54012bf (diff) | |
download | r8-b59ea06a6314f3769dfa44328219f5709f8bb9f6.tar.gz |
Merge remote-tracking branch 'aosp/upstream-mirror' into master
am: 756f069f1a
Change-Id: Ibfcabe82d92effd20612c4a8aab4c92db82bfd81
29 files changed, 488 insertions, 308 deletions
diff --git a/src/main/java/com/android/tools/r8/dex/VirtualFile.java b/src/main/java/com/android/tools/r8/dex/VirtualFile.java index 0e89d4a10..f336a3d2d 100644 --- a/src/main/java/com/android/tools/r8/dex/VirtualFile.java +++ b/src/main/java/com/android/tools/r8/dex/VirtualFile.java @@ -67,7 +67,7 @@ public class VirtualFile { // TODO(sgjesse): Does "minimal main dex" combined with "leave space for growth" make sense? } - private static final int MAX_ENTRIES = (Short.MAX_VALUE << 1) + 1; + private static final int MAX_ENTRIES = Constants.U16BIT_MAX + 1; /** * When distributing classes across files we aim to leave some space. The amount of space left is * driven by this constant. diff --git a/src/main/java/com/android/tools/r8/graph/DexClass.java b/src/main/java/com/android/tools/r8/graph/DexClass.java index 3bcf6e749..023cfb0e4 100644 --- a/src/main/java/com/android/tools/r8/graph/DexClass.java +++ b/src/main/java/com/android/tools/r8/graph/DexClass.java @@ -7,8 +7,11 @@ import com.android.tools.r8.Resource; import com.android.tools.r8.dex.MixedSectionCollection; import com.android.tools.r8.errors.CompilationError; import com.android.tools.r8.errors.Unreachable; + import com.google.common.base.MoreObjects; +import java.util.function.Consumer; + public abstract class DexClass extends DexItem { private static final DexEncodedMethod[] NO_METHODS = {}; @@ -71,6 +74,14 @@ public abstract class DexClass extends DexItem { return MoreObjects.firstNonNull(virtualMethods, NO_METHODS); } + public void forEachMethod(Consumer<DexEncodedMethod> consumer) { + for (DexEncodedMethod method : directMethods()) { + consumer.accept(method); + } + for (DexEncodedMethod method : virtualMethods()) { + consumer.accept(method); + } + } public DexEncodedField[] staticFields() { return MoreObjects.firstNonNull(staticFields, NO_FIELDS); diff --git a/src/main/java/com/android/tools/r8/graph/ObjectToOffsetMapping.java b/src/main/java/com/android/tools/r8/graph/ObjectToOffsetMapping.java index 7dab70aff..74a08003e 100644 --- a/src/main/java/com/android/tools/r8/graph/ObjectToOffsetMapping.java +++ b/src/main/java/com/android/tools/r8/graph/ObjectToOffsetMapping.java @@ -88,7 +88,7 @@ public class ObjectToOffsetMapping { private void setIndexes(IndexedDexItem[] items) { int index = 0; for (IndexedDexItem item : items) { - item.assignVirtualFileIndex(virtualFileId, index++); + item.assignVirtualFileIndex(virtualFileId, index); // For strings collect the first jumbo string (if any). if (index > Constants.MAX_NON_JUMBO_INDEX) { assert item instanceof DexString; @@ -96,6 +96,7 @@ public class ObjectToOffsetMapping { firstJumboString = (DexString) item; } } + index++; } } diff --git a/src/main/java/com/android/tools/r8/ir/code/Value.java b/src/main/java/com/android/tools/r8/ir/code/Value.java index 92bb7b20a..e0bfdd0c9 100644 --- a/src/main/java/com/android/tools/r8/ir/code/Value.java +++ b/src/main/java/com/android/tools/r8/ir/code/Value.java @@ -57,7 +57,7 @@ public class Value { public static final Value UNDEFINED = new Value(-1, MoveType.OBJECT, null); protected final int number; - protected MoveType type; + protected final MoveType type; public Instruction definition = null; private LinkedList<Instruction> users = new LinkedList<>(); private Set<Instruction> uniqueUsers = null; @@ -71,7 +71,7 @@ public class Value { private boolean isThis = false; private boolean isArgument = false; private LongInterval valueRange; - private DebugData debugData; + private final DebugData debugData; public Value(int number, MoveType type, DebugInfo debugInfo) { this.number = number; diff --git a/src/main/java/com/android/tools/r8/ir/conversion/CallGraph.java b/src/main/java/com/android/tools/r8/ir/conversion/CallGraph.java index c5068678f..4d8eee148 100644 --- a/src/main/java/com/android/tools/r8/ir/conversion/CallGraph.java +++ b/src/main/java/com/android/tools/r8/ir/conversion/CallGraph.java @@ -20,6 +20,7 @@ import com.android.tools.r8.shaking.Enqueuer.AppInfoWithLiveness; import com.google.common.collect.Sets; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.IdentityHashMap; import java.util.LinkedHashMap; import java.util.LinkedHashSet; @@ -48,13 +49,13 @@ public class CallGraph { public final DexEncodedMethod method; private int invokeCount = 0; - private boolean isRecursive = false; + private boolean isSelfRecursive = false; // Outgoing calls from this method. - public final Set<Node> calls = new LinkedHashSet<>(); + public final Set<Node> callees = new LinkedHashSet<>(); // Incoming calls to this method. - public final Set<Node> callees = new LinkedHashSet<>(); + public final Set<Node> callers = new LinkedHashSet<>(); private Node(DexEncodedMethod method) { this.method = method; @@ -64,24 +65,24 @@ public class CallGraph { return method.accessFlags.isBridge(); } - private void addCalls(Node method) { - calls.add(method); + private void addCallee(Node method) { + callees.add(method); } private void addCaller(Node method) { - callees.add(method); + callers.add(method); } - boolean isRecursive() { - return isRecursive; + boolean isSelfRecursive() { + return isSelfRecursive; } boolean isLeaf() { - return calls.isEmpty(); + return callees.isEmpty(); } int callDegree() { - return calls.size(); + return callees.size(); } @Override @@ -100,31 +101,31 @@ public class CallGraph { builder.append("MethodNode for: "); builder.append(method.qualifiedName()); builder.append(" ("); - builder.append(calls.size()); - builder.append(" calls, "); builder.append(callees.size()); - builder.append(" callees"); + builder.append(" callees, "); + builder.append(callers.size()); + builder.append(" callers"); if (isBridge()) { builder.append(", bridge"); } - if (isRecursive()) { + if (isSelfRecursive()) { builder.append(", recursive"); } builder.append(", invoke count " + invokeCount); builder.append(").\n"); - if (calls.size() > 0) { - builder.append("Calls:\n"); - for (Node call : calls) { + if (callees.size() > 0) { + builder.append("Callees:\n"); + for (Node call : callees) { builder.append(" "); builder.append(call.method.qualifiedName()); builder.append("\n"); } } - if (callees.size() > 0) { - builder.append("Callees:\n"); - for (Node callee : callees) { + if (callers.size() > 0) { + builder.append("Callers:\n"); + for (Node caller : callers) { builder.append(" "); - builder.append(callee.method.qualifiedName()); + builder.append(caller.method.qualifiedName()); builder.append("\n"); } } @@ -154,7 +155,7 @@ public class CallGraph { return leaves; } - public boolean brokeCycles() { + public boolean hasBrokeCycles() { return brokeCycles; } @@ -182,6 +183,8 @@ public class CallGraph { } private final Map<DexEncodedMethod, Node> nodes = new LinkedHashMap<>(); + private final Map<DexEncodedMethod, Set<DexEncodedMethod>> breakers = new HashMap<>(); + private List<Node> leaves = null; private Set<DexEncodedMethod> singleCallSite = Sets.newIdentityHashSet(); private Set<DexEncodedMethod> doubleCallSite = Sets.newIdentityHashSet(); @@ -190,22 +193,15 @@ public class CallGraph { GraphLense graphLense) { CallGraph graph = new CallGraph(); - for (DexClass clazz : application.classes()) { - for (DexEncodedMethod method : clazz.directMethods()) { - Node node = graph.ensureMethodNode(method); - InvokeExtractor extractor = new InvokeExtractor(appInfo, graphLense, node, graph); - method.registerReachableDefinitions(extractor); - } - for (DexEncodedMethod method : clazz.virtualMethods()) { + clazz.forEachMethod( method -> { Node node = graph.ensureMethodNode(method); InvokeExtractor extractor = new InvokeExtractor(appInfo, graphLense, node, graph); method.registerReachableDefinitions(extractor); - } + }); } assert allMethodsExists(application, graph); - graph.fillCallSiteSets(appInfo); graph.fillInitialLeaves(); return graph; @@ -255,12 +251,7 @@ public class CallGraph { private static boolean allMethodsExists(DexApplication application, CallGraph graph) { for (DexProgramClass clazz : application.classes()) { - for (DexEncodedMethod method : clazz.directMethods()) { - assert graph.nodes.get(method) != null; - } - for (DexEncodedMethod method : clazz.virtualMethods()) { - assert graph.nodes.get(method) != null; - } + clazz.forEachMethod( method -> { assert graph.nodes.get(method) != null; }); } return true; } @@ -275,7 +266,7 @@ public class CallGraph { List<DexEncodedMethod> result = new ArrayList<>(); List<Node> newLeaves = new ArrayList<>(); for (Node leaf : leaves) { - assert nodes.containsKey(leaf.method) && nodes.get(leaf.method).calls.isEmpty(); + assert nodes.containsKey(leaf.method) && nodes.get(leaf.method).callees.isEmpty(); remove(leaf, newLeaves); result.add(leaf.method); } @@ -368,30 +359,30 @@ public class CallGraph { assert caller != null; assert callee != null; if (caller != callee) { - caller.addCalls(callee); + caller.addCallee(callee); callee.addCaller(caller); } else { - caller.isRecursive = true; + caller.isSelfRecursive = true; } callee.invokeCount++; } private Set<DexEncodedMethod> removeAllCalls(Node node) { Set<DexEncodedMethod> calls = Sets.newIdentityHashSet(); - for (Node call : node.calls) { + for (Node call : node.callees) { calls.add(call.method); - call.callees.remove(node); + call.callers.remove(node); } - node.calls.clear(); + node.callees.clear(); return calls; } private void remove(Node node, List<Node> leaves) { assert node != null; - for (Node callee : node.callees) { - boolean removed = callee.calls.remove(node); - if (callee.isLeaf()) { - leaves.add(callee); + for (Node caller : node.callers) { + boolean removed = caller.callees.remove(node); + if (caller.isLeaf()) { + leaves.add(caller); } assert removed; } diff --git a/src/main/java/com/android/tools/r8/ir/conversion/IRConverter.java b/src/main/java/com/android/tools/r8/ir/conversion/IRConverter.java index 1586496c1..98a261914 100644 --- a/src/main/java/com/android/tools/r8/ir/conversion/IRConverter.java +++ b/src/main/java/com/android/tools/r8/ir/conversion/IRConverter.java @@ -40,7 +40,6 @@ import com.android.tools.r8.utils.Timing; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -277,11 +276,9 @@ public class IRConverter { // Process the application identifying outlining candidates. timing.begin("IR conversion phase 1"); - int count = 0; OptimizationFeedback directFeedback = new OptimizationFeedbackDirect(); OptimizationFeedbackDelayed delayedFeedback = new OptimizationFeedbackDelayed(); while (!callGraph.isEmpty()) { - count++; CallGraph.Leaves leaves = callGraph.pickLeaves(); List<DexEncodedMethod> methods = leaves.getLeaves(); assert methods.size() > 0; @@ -297,15 +294,26 @@ public class IRConverter { // optimization feedback to reprocess methods affected by it. This is required to get // deterministic behaviour, as the processing order within each set of leaves is // non-deterministic. - for (DexEncodedMethod method : methods) { - futures.add(executorService.submit(() -> { + + // Due to a race condition, we serialize processing of methods if cycles are broken. + // TODO(bak) + if (leaves.hasBrokeCycles()) { + for (DexEncodedMethod method : methods) { processMethod(method, - leaves.brokeCycles() ? delayedFeedback : directFeedback, + leaves.hasBrokeCycles() ? delayedFeedback : directFeedback, outliner == null ? Outliner::noProcessing : outliner::identifyCandidates); - })); + } + } else { + for (DexEncodedMethod method : methods) { + futures.add(executorService.submit(() -> { + processMethod(method, + leaves.hasBrokeCycles() ? delayedFeedback : directFeedback, + outliner == null ? Outliner::noProcessing : outliner::identifyCandidates); + })); + } + ThreadUtils.awaitFutures(futures); } - ThreadUtils.awaitFutures(futures); - if (leaves.brokeCycles()) { + if (leaves.hasBrokeCycles()) { // If cycles in the call graph were broken, then re-process all methods which are // affected by the optimization feedback of other methods in this group. methods = delayedFeedback.applyAndClear(methods, leaves); @@ -320,13 +328,9 @@ public class IRConverter { Builder builder = new Builder(application); builder.setHighestSortingString(highestSortingString); - // Second inlining pass. - if ((inliner != null) && (inliner.doubleInlineCallers.size() > 0)) { - inliner.applyDoubleInlining = true; - for (DexEncodedMethod method : inliner.doubleInlineCallers) { - processMethod(method, ignoreOptimizationFeedback, Outliner::noProcessing); - assert method.isProcessed(); - } + // Second inlining pass for dealing with double inline callers. + if (inliner != null) { + inliner.processDoubleInlineCallers(this, ignoreOptimizationFeedback); } synthesizeLambdaClasses(builder); @@ -363,8 +367,7 @@ public class IRConverter { } private void clearDexMethodCompilationState(DexProgramClass clazz) { - Arrays.stream(clazz.directMethods()).forEach(DexEncodedMethod::markNotProcessed); - Arrays.stream(clazz.virtualMethods()).forEach(DexEncodedMethod::markNotProcessed); + clazz.forEachMethod(DexEncodedMethod::markNotProcessed); } /** @@ -413,12 +416,7 @@ public class IRConverter { public void optimizeSynthesizedClass(DexProgramClass clazz) { // Process the generated class, but don't apply any outlining. - for (DexEncodedMethod method : clazz.directMethods()) { - optimizeSynthesizedMethod(method); - } - for (DexEncodedMethod method : clazz.virtualMethods()) { - optimizeSynthesizedMethod(method); - } + clazz.forEachMethod(this::optimizeSynthesizedMethod); } public void optimizeSynthesizedMethod(DexEncodedMethod method) { @@ -430,7 +428,7 @@ public class IRConverter { return options.useSmaliSyntax ? method.toSmaliString(null) : method.codeToString(); } - private void processMethod(DexEncodedMethod method, + public void processMethod(DexEncodedMethod method, OptimizationFeedback feedback, BiConsumer<IRCode, DexEncodedMethod> outlineHandler) { Code code = method.getCode(); diff --git a/src/main/java/com/android/tools/r8/ir/optimize/CodeRewriter.java b/src/main/java/com/android/tools/r8/ir/optimize/CodeRewriter.java index 2364668ab..203ca80a3 100644 --- a/src/main/java/com/android/tools/r8/ir/optimize/CodeRewriter.java +++ b/src/main/java/com/android/tools/r8/ir/optimize/CodeRewriter.java @@ -66,6 +66,7 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; +import java.util.IdentityHashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -853,7 +854,7 @@ public class CodeRewriter { private void splitPhiConstants(IRCode code, BasicBlock block) { for (int i = 0; i < block.getPredecessors().size(); i++) { - Map<ConstNumber, ConstNumber> oldToNew = new HashMap<>(); + Map<ConstNumber, ConstNumber> oldToNew = new IdentityHashMap<>(); BasicBlock predecessor = block.getPredecessors().get(i); for (Phi phi : block.getPhis()) { Value operand = phi.getOperand(i); diff --git a/src/main/java/com/android/tools/r8/ir/optimize/Inliner.java b/src/main/java/com/android/tools/r8/ir/optimize/Inliner.java index 1f21f5245..6d6981757 100644 --- a/src/main/java/com/android/tools/r8/ir/optimize/Inliner.java +++ b/src/main/java/com/android/tools/r8/ir/optimize/Inliner.java @@ -19,7 +19,9 @@ import com.android.tools.r8.ir.code.InvokeMethod; import com.android.tools.r8.ir.code.Value; import com.android.tools.r8.ir.code.ValueNumberGenerator; import com.android.tools.r8.ir.conversion.CallGraph; +import com.android.tools.r8.ir.conversion.IRConverter; import com.android.tools.r8.ir.conversion.LensCodeRewriter; +import com.android.tools.r8.ir.conversion.OptimizationFeedback; import com.android.tools.r8.logging.Log; import com.android.tools.r8.utils.InternalOptions; import com.google.common.collect.Sets; @@ -39,10 +41,10 @@ public class Inliner { private final InternalOptions options; // State for inlining methods which are known to be called twice. - public boolean applyDoubleInlining = false; - public final Set<DexEncodedMethod> doubleInlineCallers = Sets.newIdentityHashSet(); - public final Set<DexEncodedMethod> doubleInlineSelectedTargets = Sets.newIdentityHashSet(); - public final Map<DexEncodedMethod, DexEncodedMethod> doubleInlineeCandidates = new HashMap<>(); + private boolean applyDoubleInlining = false; + private final Set<DexEncodedMethod> doubleInlineCallers = Sets.newIdentityHashSet(); + private final Set<DexEncodedMethod> doubleInlineSelectedTargets = Sets.newIdentityHashSet(); + private final Map<DexEncodedMethod, DexEncodedMethod> doubleInlineeCandidates = new HashMap<>(); public Inliner(AppInfoWithSubtyping appInfo, GraphLense graphLense, InternalOptions options) { this.appInfo = appInfo; @@ -89,7 +91,7 @@ public class Inliner { return result; } - protected boolean hasInliningAccess(DexEncodedMethod method, DexEncodedMethod target) { + boolean hasInliningAccess(DexEncodedMethod method, DexEncodedMethod target) { if (target.accessFlags.isPublic()) { return true; } @@ -105,6 +107,40 @@ public class Inliner { return methodHolder.isSamePackage(targetHolder); } + synchronized DexEncodedMethod doubleInlining(DexEncodedMethod method, + DexEncodedMethod target) { + if (!applyDoubleInlining) { + if (doubleInlineeCandidates.containsKey(target)) { + // Both calls can be inlined. + doubleInlineCallers.add(doubleInlineeCandidates.get(target)); + doubleInlineCallers.add(method); + doubleInlineSelectedTargets.add(target); + } else { + // First call can be inlined. + doubleInlineeCandidates.put(target, method); + } + // Just preparing for double inlining. + return null; + } else { + // Don't perform the actual inlining if this was not selected. + if (!doubleInlineSelectedTargets.contains(target)) { + return null; + } + } + return target; + } + + public synchronized void processDoubleInlineCallers(IRConverter converter, + OptimizationFeedback feedback) { + if (doubleInlineCallers.size() > 0) { + applyDoubleInlining = true; + for (DexEncodedMethod method : doubleInlineCallers) { + converter.processMethod(method, feedback, Outliner::noProcessing); + assert method.isProcessed(); + } + } + } + public enum Constraint { // The ordinal values are important so please do not reorder. NEVER, // Never inline this. diff --git a/src/main/java/com/android/tools/r8/ir/optimize/InliningOracle.java b/src/main/java/com/android/tools/r8/ir/optimize/InliningOracle.java index febef8206..4b93d8d77 100644 --- a/src/main/java/com/android/tools/r8/ir/optimize/InliningOracle.java +++ b/src/main/java/com/android/tools/r8/ir/optimize/InliningOracle.java @@ -82,28 +82,6 @@ public class InliningOracle { return candidate; } - private synchronized DexEncodedMethod doubleInlining(DexEncodedMethod candidate) { - if (!inliner.applyDoubleInlining) { - if (inliner.doubleInlineeCandidates.containsKey(candidate)) { - // Both calls can be inlined. - inliner.doubleInlineCallers.add(inliner.doubleInlineeCandidates.get(candidate)); - inliner.doubleInlineCallers.add(method); - inliner.doubleInlineSelectedTargets.add(candidate); - } else { - // First call can be inlined. - inliner.doubleInlineeCandidates.put(candidate, method); - } - // Just preparing for double inlining. - return null; - } else { - // Don't perform the actual inlining if this was not selected. - if (!inliner.doubleInlineSelectedTargets.contains(candidate)) { - return null; - } - } - return candidate; - } - private Reason computeInliningReason(DexEncodedMethod target) { if (target.getOptimizationInfo().forceInline()) { return Reason.FORCE; @@ -185,7 +163,7 @@ public class InliningOracle { } // Attempt to inline a candidate that is only called twice. - if ((reason == Reason.DUAL_CALLER) && (doubleInlining(target) == null)) { + if ((reason == Reason.DUAL_CALLER) && (inliner.doubleInlining(method, target) == null)) { if (info != null) { info.exclude(invoke, "target is not ready for double inlining"); } @@ -253,7 +231,7 @@ public class InliningOracle { } // Attempt to inline a candidate that is only called twice. - if ((reason == Reason.DUAL_CALLER) && (doubleInlining(candidate) == null)) { + if ((reason == Reason.DUAL_CALLER) && (inliner.doubleInlining(method, candidate) == null)) { if (info != null) { info.exclude(invoke, "target is not ready for double inlining"); } diff --git a/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java b/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java index 13f2d2953..fe59b791b 100644 --- a/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java +++ b/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java @@ -38,6 +38,8 @@ import it.unimi.dsi.fastutil.ints.IntArraySet; import it.unimi.dsi.fastutil.ints.IntIterator; import it.unimi.dsi.fastutil.ints.IntSet; import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.Iterator; @@ -136,7 +138,7 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { private List<LiveIntervals> inactive = new LinkedList<>(); // List of intervals that no register has been allocated to sorted by first live range. private PriorityQueue<LiveIntervals> unhandled = - new PriorityQueue<>((o1, o2) -> Integer.compare(o1.getStart(), o2.getStart())); + new PriorityQueue<>(Comparator.comparingInt(LiveIntervals::getStart)); // The first register used for parallel moves. After register allocation the parallel move // temporary registers are [firstParallelMoveTemporary, maxRegisterNumber]. @@ -1354,10 +1356,6 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { unhandled.add(split); } else if (blockedPosition > unhandledInterval.getEnd()) { // Spilling can make a register available for the entire interval. - // It would have been nice to use assignRegisterToUnhandledInterval here, but unfortunately - // the order of the operations are extremely important here. updateRegisterState has to - // happen before spillOverlappingActiveIntervals and takeRegistersForIntervals has to happen - // after. assignRegisterAndSpill(unhandledInterval, needsRegisterPair, candidate); } else { // Spilling only makes a register available for the first part of current. @@ -1390,7 +1388,9 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { } private void assignRegisterAndSpill( - LiveIntervals unhandledInterval, boolean needsRegisterPair, int candidate) { + LiveIntervals unhandledInterval, + boolean needsRegisterPair, + int candidate) { assignRegister(unhandledInterval, candidate); updateRegisterState(candidate, needsRegisterPair); // Split and spill intersecting active intervals for this register. @@ -1402,14 +1402,21 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { splitOverlappingInactiveIntervals(unhandledInterval, needsRegisterPair, candidate); } - private void splitOverlappingInactiveIntervals(LiveIntervals unhandledInterval, - boolean needsRegisterPair, int candidate) { + private void splitOverlappingInactiveIntervals( + LiveIntervals unhandledInterval, + boolean needsRegisterPair, + int candidate) { Iterator<LiveIntervals> inactiveIterator = inactive.iterator(); while (inactiveIterator.hasNext()) { LiveIntervals intervals = inactiveIterator.next(); if ((intervals.usesRegister(candidate) || (needsRegisterPair && intervals.usesRegister(candidate + 1))) && intervals.overlaps(unhandledInterval)) { + // If these assertions trigger we have changed the way blocked parts of intervals + // are handled. If we ever get intervals with fixed registers in here, we need + // to split them before the first use in the same way that we do when spilling + // overlapping active intervals. + assert !intervals.isLinked() || intervals.isArgumentInterval(); if (intervals.getStart() > unhandledInterval.getStart()) { // The inactive live intervals hasn't started yet. Clear the temporary register // assignment and move back to unhandled for register reassignment. @@ -1426,8 +1433,10 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { } } - private void spillOverlappingActiveIntervals(LiveIntervals unhandledInterval, - boolean needsRegisterPair, int candidate) { + private void spillOverlappingActiveIntervals( + LiveIntervals unhandledInterval, + boolean needsRegisterPair, + int candidate) { List<LiveIntervals> newActive = new ArrayList<>(); Iterator<LiveIntervals> activeIterator = active.iterator(); while (activeIterator.hasNext()) { @@ -1844,8 +1853,6 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { live.add(use); addLiveRange(use, block, number); } - LiveIntervals useIntervals = use.getLiveIntervals(); - useIntervals.addUse(new LiveIntervalsUse(number, Constants.U16BIT_MAX, true)); } Value use = instruction.getPreviousLocalValue(); if (use != null) { @@ -1854,8 +1861,6 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { live.add(use); addLiveRange(use, block, number); } - LiveIntervals useIntervals = use.getLiveIntervals(); - useIntervals.addUse(new LiveIntervalsUse(number, Constants.U16BIT_MAX, true)); } } } @@ -1887,14 +1892,27 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { Value previous = null; for (int i = 0; i < arguments.size(); i++) { Value argument = arguments.get(i); - // TODO(ager): Conditionally create a new argument if it is not already a move. - // Reverted optimization from CL: https://r8-review.googlesource.com/c/1985/ - // Not considering debug-uses causes a unlinked/non-consecutive register in some cases. - Value newArgument = createValue(argument.outType()); - Move move = new Move(newArgument, argument); - move.setBlock(invoke.getBlock()); - replaceArgument(invoke, i, newArgument); - insertAt.add(move); + Value newArgument = argument; + // In debug mode, we have debug instructions that are also moves. Do not generate another + // move if there already is a move instruction that we can use. We generate moves if: + // + // 1. the argument is not defined by a move, + // + // 2. the argument is already linked or would cause a cycle if linked, or + // + // 3. the argument has a register constraint (the argument moves are there to make the + // input value to a ranged invoke unconstrained.) + if (argument.definition == null || + !argument.definition.isMove() || + argument.isLinked() || + argument == previous || + argument.hasRegisterConstraint()) { + newArgument = createValue(argument.outType()); + Move move = new Move(newArgument, argument); + move.setBlock(invoke.getBlock()); + replaceArgument(invoke, i, newArgument); + insertAt.add(move); + } if (previous != null) { previous.linkTo(newArgument); } diff --git a/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervals.java b/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervals.java index 9c28724a7..06b33f473 100644 --- a/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervals.java +++ b/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervals.java @@ -319,7 +319,7 @@ public class LiveIntervals { public int firstUseAfter(int unhandledStart) { for (LiveIntervalsUse use : uses) { - if (use.getPosition() >= unhandledStart && !use.isDebugUse()) { + if (use.getPosition() >= unhandledStart) { return use.getPosition(); } } diff --git a/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java b/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java index edf876ded..db8e48de6 100644 --- a/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java +++ b/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java @@ -8,16 +8,10 @@ import static com.android.tools.r8.dex.Constants.U16BIT_MAX; public class LiveIntervalsUse implements Comparable<LiveIntervalsUse> { private final int position; private final int limit; - private final boolean debugUse; public LiveIntervalsUse(int position, int limit) { - this(position, limit, false); - } - - public LiveIntervalsUse(int position, int limit, boolean debugUse) { this.position = position; this.limit = limit; - this.debugUse = debugUse; } public int getPosition() { @@ -53,8 +47,4 @@ public class LiveIntervalsUse implements Comparable<LiveIntervalsUse> { public boolean hasConstraint() { return limit < U16BIT_MAX; } - - public boolean isDebugUse() { - return debugUse; - } } diff --git a/src/main/java/com/android/tools/r8/utils/AndroidApp.java b/src/main/java/com/android/tools/r8/utils/AndroidApp.java index 7b9d45d45..e5088347f 100644 --- a/src/main/java/com/android/tools/r8/utils/AndroidApp.java +++ b/src/main/java/com/android/tools/r8/utils/AndroidApp.java @@ -278,8 +278,11 @@ public class AndroidApp { try (Closer closer = Closer.create()) { List<Resource> dexProgramSources = getDexProgramResources(); for (int i = 0; i < dexProgramSources.size(); i++) { - Path fileName = directory.resolve(outputMode.getFileName(dexProgramSources.get(i), i)); - Files.copy(dexProgramSources.get(i).getStream(closer), fileName, options); + Path filePath = directory.resolve(outputMode.getOutputPath(dexProgramSources.get(i), i)); + if (!Files.exists(filePath.getParent())) { + Files.createDirectories(filePath.getParent()); + } + Files.copy(dexProgramSources.get(i).getStream(closer), filePath, options); } } } @@ -333,7 +336,7 @@ public class AndroidApp { try (ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(archive, options))) { List<Resource> dexProgramSources = getDexProgramResources(); for (int i = 0; i < dexProgramSources.size(); i++) { - ZipEntry zipEntry = new ZipEntry(outputMode.getFileName(dexProgramSources.get(i), i)); + ZipEntry zipEntry = new ZipEntry(outputMode.getOutputPath(dexProgramSources.get(i), i)); byte[] bytes = ByteStreams.toByteArray(dexProgramSources.get(i).getStream(closer)); zipEntry.setSize(bytes.length); out.putNextEntry(zipEntry); diff --git a/src/main/java/com/android/tools/r8/utils/FileUtils.java b/src/main/java/com/android/tools/r8/utils/FileUtils.java index 47a72a38a..16f41cc04 100644 --- a/src/main/java/com/android/tools/r8/utils/FileUtils.java +++ b/src/main/java/com/android/tools/r8/utils/FileUtils.java @@ -75,9 +75,12 @@ public class FileUtils { public static Path validateOutputFile(Path path) throws CompilationException { if (path != null) { - if (!isZipFile(path) && !(Files.exists(path) && Files.isDirectory(path))) { + boolean isJarOrZip = isZipFile(path) || isJarFile(path); + if (!isJarOrZip && !(Files.exists(path) && Files.isDirectory(path))) { throw new CompilationException( - "Invalid output: " + path + "\nOutput must be a zip archive or an existing directory"); + "Invalid output: " + + path + + "\nOutput must be a .zip or .jar archive or an existing directory"); } } return path; diff --git a/src/main/java/com/android/tools/r8/utils/OutputMode.java b/src/main/java/com/android/tools/r8/utils/OutputMode.java index ce743e82e..1bdf50174 100644 --- a/src/main/java/com/android/tools/r8/utils/OutputMode.java +++ b/src/main/java/com/android/tools/r8/utils/OutputMode.java @@ -10,21 +10,21 @@ import java.util.Set; public enum OutputMode { Indexed { @Override - String getFileName(Resource resource, int index) { + String getOutputPath(Resource resource, int index) { return index == 0 ? "classes.dex" : ("classes" + (index + 1) + ".dex"); } }, FilePerClass { @Override - String getFileName(Resource resource, int index) { + String getOutputPath(Resource resource, int index) { Set<String> classDescriptors = resource.getClassDescriptors(); assert classDescriptors != null; assert classDescriptors.size() == 1; String classDescriptor = classDescriptors.iterator().next(); - assert !classDescriptor.contains("."); - return DescriptorUtils.descriptorToJavaType(classDescriptor) + ".dex"; + assert DescriptorUtils.isClassDescriptor(classDescriptor); + return classDescriptor.substring(1, classDescriptor.length() - 1) + ".dex"; } }; - abstract String getFileName(Resource resource, int index); + abstract String getOutputPath(Resource resource, int index); } diff --git a/src/test/java/com/android/tools/r8/D8IncrementalRunExamplesAndroidOTest.java b/src/test/java/com/android/tools/r8/D8IncrementalRunExamplesAndroidOTest.java index db81f17a1..d8b9bbc07 100644 --- a/src/test/java/com/android/tools/r8/D8IncrementalRunExamplesAndroidOTest.java +++ b/src/test/java/com/android/tools/r8/D8IncrementalRunExamplesAndroidOTest.java @@ -5,6 +5,7 @@ package com.android.tools.r8; import static com.android.tools.r8.utils.FileUtils.JAR_EXTENSION; +import static org.junit.Assert.assertEquals; import com.android.tools.r8.errors.CompilationError; import com.android.tools.r8.errors.InternalCompilerError; @@ -264,18 +265,25 @@ public abstract class D8IncrementalRunExamplesAndroidOTest D8IncrementalTestRunner test = test(testName, testPackage, mainClass); test.compileClassesTogether(inputJarFile, out); - String[] dexFiles = out.toFile().list(); + + String[] topLevelDir = out.toFile().list(); + assert topLevelDir != null; + assertEquals(1, topLevelDir.length); + assertEquals("incremental", topLevelDir[0]); + + String[] dexFiles = out.resolve(topLevelDir[0]).toFile().list(); assert dexFiles != null; Arrays.sort(dexFiles); String[] expectedFileNames = { - "incremental.IncrementallyCompiled$A$AB.dex", - "incremental.IncrementallyCompiled$A.dex", - "incremental.IncrementallyCompiled$B$BA.dex", - "incremental.IncrementallyCompiled$B.dex", - "incremental.IncrementallyCompiled$C.dex", - "incremental.IncrementallyCompiled.dex" + "IncrementallyCompiled$A$AB.dex", + "IncrementallyCompiled$A.dex", + "IncrementallyCompiled$B$BA.dex", + "IncrementallyCompiled$B.dex", + "IncrementallyCompiled$C.dex", + "IncrementallyCompiled.dex" }; + Arrays.sort(expectedFileNames); Assert.assertArrayEquals(expectedFileNames, dexFiles); } diff --git a/src/test/java/com/android/tools/r8/JctfTestSpecifications.java b/src/test/java/com/android/tools/r8/JctfTestSpecifications.java index 8dc725508..eba8db600 100644 --- a/src/test/java/com/android/tools/r8/JctfTestSpecifications.java +++ b/src/test/java/com/android/tools/r8/JctfTestSpecifications.java @@ -138,7 +138,7 @@ public class JctfTestSpecifications { // 1) t01 // org.junit.ComparisonFailure: expected:<get[]StackTrace> but was:<get[Thread]StackTrace> - .put("lang.Thread.enumerate$Ljava_lang_Thread.Thread_enumerate_A02", any()) + .put("lang.Thread.enumerate_Ljava_lang_Thread.Thread_enumerate_A02", any()) // 1) t01 // java.lang.AssertionError: test failed with error:java.lang.SecurityException @@ -153,7 +153,7 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Expected exception: java.lang.IllegalThreadStateException .put("lang.Thread.getAllStackTraces.Thread_getAllStackTraces_A01", - match(runtimes(DexVm.ART_DEFAULT, DexVm.ART_7_0_0))) + match(runtimes(DexVm.ART_7_0_0))) // 1) t01 // java.lang.AssertionError @@ -195,7 +195,7 @@ public class JctfTestSpecifications { // java.lang.UnsupportedOperationException .put("lang.Thread.getContextClassLoader.Thread_getContextClassLoader_A03", - match(runtimes(DexVm.ART_DEFAULT, DexVm.ART_7_0_0))) + match(runtimes(DexVm.ART_7_0_0))) // 1) t01 // java.lang.AssertionError: improper ClassLoader expected same:<null> was not:<dalvik.system.PathClassLoader[DexPathList[[dex file "/tmp/junit7794202178392390143/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]]]> @@ -316,8 +316,8 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructors.Class_getDeclaredConstructors_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 3) t03 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> - // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructor$Ljava_lang_Class/Class_getDeclaredConstructor_A03; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructor$Ljava_lang_Class.Class_getDeclaredConstructor_A03" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructor_Ljava_lang_Class/Class_getDeclaredConstructor_A03; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructor_Ljava_lang_Class.Class_getDeclaredConstructor_A03" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 4) t04 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredFields/Class_getDeclaredFields_A02; @@ -332,8 +332,8 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethods.Class_getDeclaredMethods_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 7) t07 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> - // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethodLjava_lang_String$Ljava_lang_Class/Class_getDeclaredMethod_A05; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethodLjava_lang_String$Ljava_lang_Class.Class_getDeclaredMethod_A05" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethodLjava_lang_String_Ljava_lang_Class/Class_getDeclaredMethod_A05; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethodLjava_lang_String_Ljava_lang_Class.Class_getDeclaredMethod_A05" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 8) t08 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredClasses/Class_getDeclaredClasses_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredClasses.Class_getDeclaredClasses_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -341,8 +341,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructors/Class_getDeclaredConstructors_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructors.Class_getDeclaredConstructors_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 10) t10 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructor$Ljava_lang_Class/Class_getDeclaredConstructor_A03; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructor$Ljava_lang_Class.Class_getDeclaredConstructor_A03" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructor_Ljava_lang_Class/Class_getDeclaredConstructor_A03; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructor_Ljava_lang_Class.Class_getDeclaredConstructor_A03" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 11) t11 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredFields/Class_getDeclaredFields_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredFields.Class_getDeclaredFields_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -353,8 +353,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethods/Class_getDeclaredMethods_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethods.Class_getDeclaredMethods_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 14) t14 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethodLjava_lang_String$Ljava_lang_Class/Class_getDeclaredMethod_A05; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethodLjava_lang_String$Ljava_lang_Class.Class_getDeclaredMethod_A05" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethodLjava_lang_String_Ljava_lang_Class/Class_getDeclaredMethod_A05; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethodLjava_lang_String_Ljava_lang_Class.Class_getDeclaredMethod_A05" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 15) t15 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/newInstance/Class_newInstance_A07; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.newInstance.Class_newInstance_A07" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -372,8 +372,8 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructors.Class_getConstructors_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 19) t19 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> - // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructor$Ljava_lang_Class/Class_getConstructor_A04; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructor$Ljava_lang_Class.Class_getConstructor_A04" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructor_Ljava_lang_Class/Class_getConstructor_A04; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructor_Ljava_lang_Class.Class_getConstructor_A04" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 20) t20 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getFields/Class_getFields_A02; @@ -388,8 +388,8 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethods.Class_getMethods_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 23) t23 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> - // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethodLjava_lang_String$Ljava_lang_Class/Class_getMethod_A05; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A05" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethodLjava_lang_String_Ljava_lang_Class/Class_getMethod_A05; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String_Ljava_lang_Class.Class_getMethod_A05" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 24) t24 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getClasses/Class_getClasses_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getClasses.Class_getClasses_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -397,8 +397,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructors/Class_getConstructors_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructors.Class_getConstructors_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 26) t26 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructor$Ljava_lang_Class/Class_getConstructor_A04; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructor$Ljava_lang_Class.Class_getConstructor_A04" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructor_Ljava_lang_Class/Class_getConstructor_A04; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructor_Ljava_lang_Class.Class_getConstructor_A04" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 27) t27 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getFields/Class_getFields_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getFields.Class_getFields_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -409,8 +409,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethods/Class_getMethods_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethods.Class_getMethods_A02" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 30) t30 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethodLjava_lang_String$Ljava_lang_Class/Class_getMethod_A05; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A05" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethodLjava_lang_String_Ljava_lang_Class/Class_getMethod_A05; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String_Ljava_lang_Class.Class_getMethod_A05" on path: DexPathList[[dex file "/tmp/junit2603421343038865741/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 31) t31 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/SecurityManager/checkMemberAccessLjava_lang_ClassI/SecurityManager_checkMemberAccess_A02; @@ -593,8 +593,8 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructors.Class_getDeclaredConstructors_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 3) t03 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> - // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructor$Ljava_lang_Class/Class_getDeclaredConstructor_A03; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructor$Ljava_lang_Class.Class_getDeclaredConstructor_A03" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructor_Ljava_lang_Class/Class_getDeclaredConstructor_A03; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructor_Ljava_lang_Class.Class_getDeclaredConstructor_A03" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 4) t04 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredFields/Class_getDeclaredFields_A02; @@ -609,8 +609,8 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethods.Class_getDeclaredMethods_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 7) t07 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> - // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethodLjava_lang_String$Ljava_lang_Class/Class_getDeclaredMethod_A05; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethodLjava_lang_String$Ljava_lang_Class.Class_getDeclaredMethod_A05" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethodLjava_lang_String_Ljava_lang_Class/Class_getDeclaredMethod_A05; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethodLjava_lang_String_Ljava_lang_Class.Class_getDeclaredMethod_A05" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 8) t08 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredClasses/Class_getDeclaredClasses_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredClasses.Class_getDeclaredClasses_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -618,8 +618,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructors/Class_getDeclaredConstructors_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructors.Class_getDeclaredConstructors_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 10) t10 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructor$Ljava_lang_Class/Class_getDeclaredConstructor_A03; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructor$Ljava_lang_Class.Class_getDeclaredConstructor_A03" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredConstructor_Ljava_lang_Class/Class_getDeclaredConstructor_A03; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredConstructor_Ljava_lang_Class.Class_getDeclaredConstructor_A03" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 11) t11 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredFields/Class_getDeclaredFields_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredFields.Class_getDeclaredFields_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -630,8 +630,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethods/Class_getDeclaredMethods_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethods.Class_getDeclaredMethods_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 14) t14 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethodLjava_lang_String$Ljava_lang_Class/Class_getDeclaredMethod_A05; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethodLjava_lang_String$Ljava_lang_Class.Class_getDeclaredMethod_A05" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getDeclaredMethodLjava_lang_String_Ljava_lang_Class/Class_getDeclaredMethod_A05; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getDeclaredMethodLjava_lang_String_Ljava_lang_Class.Class_getDeclaredMethod_A05" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 15) t15 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/newInstance/Class_newInstance_A07; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.newInstance.Class_newInstance_A07" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -649,8 +649,8 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructors.Class_getConstructors_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 19) t19 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> - // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructor$Ljava_lang_Class/Class_getConstructor_A04; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructor$Ljava_lang_Class.Class_getConstructor_A04" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructor_Ljava_lang_Class/Class_getConstructor_A04; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructor_Ljava_lang_Class.Class_getConstructor_A04" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 20) t20 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getFields/Class_getFields_A02; @@ -665,8 +665,8 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethods.Class_getMethods_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 23) t23 // java.lang.Exception: Unexpected exception, expected<java.lang.SecurityException> but was<java.lang.NoClassDefFoundError> - // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethodLjava_lang_String$Ljava_lang_Class/Class_getMethod_A05; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A05" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethodLjava_lang_String_Ljava_lang_Class/Class_getMethod_A05; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String_Ljava_lang_Class.Class_getMethod_A05" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 24) t24 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getClasses/Class_getClasses_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getClasses.Class_getClasses_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -674,8 +674,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructors/Class_getConstructors_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructors.Class_getConstructors_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 26) t26 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructor$Ljava_lang_Class/Class_getConstructor_A04; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructor$Ljava_lang_Class.Class_getConstructor_A04" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getConstructor_Ljava_lang_Class/Class_getConstructor_A04; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getConstructor_Ljava_lang_Class.Class_getConstructor_A04" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 27) t27 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getFields/Class_getFields_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getFields.Class_getFields_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -686,8 +686,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethods/Class_getMethods_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethods.Class_getMethods_A02" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 30) t30 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethodLjava_lang_String$Ljava_lang_Class/Class_getMethod_A05; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A05" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/Class/getMethodLjava_lang_String_Ljava_lang_Class/Class_getMethod_A05; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String_Ljava_lang_Class.Class_getMethod_A05" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 31) t32 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/SecurityManager/checkPackageAccessLjava_lang_String/SecurityManager_checkPackageAccess_A01; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.SecurityManager.checkPackageAccessLjava_lang_String.SecurityManager_checkPackageAccess_A01" on path: DexPathList[[dex file "/tmp/junit7609456538458065688/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -745,7 +745,7 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/ClassLoader/ConstructorLjava_lang_ClassLoader/ClassLoader_Constructor_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ClassLoader.ConstructorLjava_lang_ClassLoader.ClassLoader_Constructor_A02" on path: DexPathList[[dex file "/tmp/junit6765412840574788386/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] - .put("lang.ClassLoader.defineClassLjava_lang_String$BII.ClassLoader_defineClass_A06", + .put("lang.ClassLoader.defineClassLjava_lang_String_BII.ClassLoader_defineClass_A06", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -775,8 +775,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/ThreadGroup/getParent/ThreadGroup_getParent_A03; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ThreadGroup.getParent.ThreadGroup_getParent_A03" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 8) t08 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/ThreadGroup/enumerate$ThreadGroup/ThreadGroup_enumerate_A03; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ThreadGroup.enumerate$ThreadGroup.ThreadGroup_enumerate_A03" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/ThreadGroup/enumerate_ThreadGroup/ThreadGroup_enumerate_A03; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ThreadGroup.enumerate_ThreadGroup.ThreadGroup_enumerate_A03" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 9) t09 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/ThreadGroup/interrupt/ThreadGroup_interrupt_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ThreadGroup.interrupt.ThreadGroup_interrupt_A02" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -799,8 +799,8 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/ThreadGroup/getParent/ThreadGroup_getParent_A02; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ThreadGroup.getParent.ThreadGroup_getParent_A02" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 16) t16 - // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/ThreadGroup/enumerate$ThreadGroup/ThreadGroup_enumerate_A03; - // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ThreadGroup.enumerate$ThreadGroup.ThreadGroup_enumerate_A03" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] + // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/ThreadGroup/enumerate_ThreadGroup/ThreadGroup_enumerate_A03; + // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ThreadGroup.enumerate_ThreadGroup.ThreadGroup_enumerate_A03" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] // 17) t17 // java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/SecurityManager/checkAccessLjava_lang_ThreadGroup/SecurityManager_checkAccess_A01; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.SecurityManager.checkAccessLjava_lang_ThreadGroup.SecurityManager_checkAccess_A01" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] @@ -809,12 +809,12 @@ public class JctfTestSpecifications { // Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/jctf/test/lib/java/lang/SecurityManager/checkAccessLjava_lang_ThreadGroup/SecurityManager_checkAccess_A01; // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.SecurityManager.checkAccessLjava_lang_ThreadGroup.SecurityManager_checkAccess_A01" on path: DexPathList[[dex file "/tmp/junit7453598412317397853/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] - .put("lang.ClassLoader.defineClassLjava_lang_String$BII.ClassLoader_defineClass_A05", + .put("lang.ClassLoader.defineClassLjava_lang_String_BII.ClassLoader_defineClass_A05", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClassLjava_lang_String$BII.ClassLoader_defineClass_A02", + .put("lang.ClassLoader.defineClassLjava_lang_String_BII.ClassLoader_defineClass_A02", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -823,26 +823,26 @@ public class JctfTestSpecifications { // 3) t03 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClassLjava_lang_String$BII.ClassLoader_defineClass_A04", + .put("lang.ClassLoader.defineClassLjava_lang_String_BII.ClassLoader_defineClass_A04", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference // 2) t02 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClassLjava_lang_String$BII.ClassLoader_defineClass_A03", + .put("lang.ClassLoader.defineClassLjava_lang_String_BII.ClassLoader_defineClass_A03", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClassLjava_lang_String$BII.ClassLoader_defineClass_A01", + .put("lang.ClassLoader.defineClassLjava_lang_String_BII.ClassLoader_defineClass_A01", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference // 2) t02 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClassLjava_lang_String$BII.ClassLoader_defineClass_A07", + .put("lang.ClassLoader.defineClassLjava_lang_String_BII.ClassLoader_defineClass_A07", any()) // 1) t01 // java.lang.Exception: Unexpected exception, expected<java.lang.NullPointerException> but was<java.lang.UnsupportedOperationException> @@ -969,7 +969,7 @@ public class JctfTestSpecifications { // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference .put( - "lang.ClassLoader.setSignersLjava_lang_Class$Ljava_lang_Object.ClassLoader_setSigners_A01", + "lang.ClassLoader.setSignersLjava_lang_Class_Ljava_lang_Object.ClassLoader_setSigners_A01", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -1025,7 +1025,7 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.ClassLoader.findLoadedClassLjava_lang_String.TestLoader" on path: DexPathList[[dex file "/tmp/junit1789265657215742712/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A02", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A02", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -1047,7 +1047,7 @@ public class JctfTestSpecifications { // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A05", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A05", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -1055,7 +1055,7 @@ public class JctfTestSpecifications { // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A01", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A01", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -1063,7 +1063,7 @@ public class JctfTestSpecifications { // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A06", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A06", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -1071,14 +1071,14 @@ public class JctfTestSpecifications { // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A08", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A08", any()) // 1) t01 // java.lang.Exception: Unexpected exception, expected<java.lang.NullPointerException> but was<java.lang.UnsupportedOperationException> // Caused by: java.lang.UnsupportedOperationException: can't load this type of class file .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A03", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A03", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -1098,25 +1098,25 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Resource not found: .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A07", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A07", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A09", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A09", any()) // 1) t01 // java.lang.Exception: Unexpected exception, expected<java.lang.NullPointerException> but was<java.lang.UnsupportedOperationException> // Caused by: java.lang.UnsupportedOperationException: can't load this type of class file .put( - "lang.ClassLoader.defineClassLjava_lang_String$BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A04", + "lang.ClassLoader.defineClassLjava_lang_String_BIILjava_security_ProtectionDomain.ClassLoader_defineClass_A04", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClass$BII.ClassLoader_defineClass_A02", any()) + .put("lang.ClassLoader.defineClass_BII.ClassLoader_defineClass_A02", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference // 2) t02 @@ -1155,19 +1155,19 @@ public class JctfTestSpecifications { // 2) t02 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClass$BII.ClassLoader_defineClass_A03", any()) + .put("lang.ClassLoader.defineClass_BII.ClassLoader_defineClass_A03", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference // 2) t02 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClass$BII.ClassLoader_defineClass_A01", any()) + .put("lang.ClassLoader.defineClass_BII.ClassLoader_defineClass_A01", any()) // 1) t01 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference // 2) t02 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.ClassLoader.defineClass$BII.ClassLoader_defineClass_A04", any()) + .put("lang.ClassLoader.defineClass_BII.ClassLoader_defineClass_A04", any()) // 1) t01 // java.lang.Exception: Unexpected exception, expected<java.lang.NullPointerException> but was<java.lang.UnsupportedOperationException> // Caused by: java.lang.UnsupportedOperationException: can't load this type of class file @@ -1293,16 +1293,16 @@ public class JctfTestSpecifications { // 2) t02 // java.lang.AssertionError - .put("lang.Runtime.exec$Ljava_lang_String.Runtime_exec_A02", any()) + .put("lang.Runtime.exec_Ljava_lang_String.Runtime_exec_A02", any()) // 1) t01 - // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.exec$Ljava_lang_String.Runtime_exec_A02$T01 + // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.exec_Ljava_lang_String.Runtime_exec_A02$T01 // ]> - .put("lang.Runtime.exec$Ljava_lang_String.Runtime_exec_A03", any()) + .put("lang.Runtime.exec_Ljava_lang_String.Runtime_exec_A03", any()) // 1) t01 // java.lang.AssertionError: expected:<0> but was:<1> - .put("lang.Runtime.exec$Ljava_lang_String.Runtime_exec_A01", any()) + .put("lang.Runtime.exec_Ljava_lang_String.Runtime_exec_A01", any()) // 1) t01 // org.junit.ComparisonFailure: expected:<[com google jctf test lib java lang Runtime]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoArgs // ]> @@ -1408,19 +1408,19 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Bad exit code of spawned java proccess, err=Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.addShutdownHookLjava_lang_Thread.Runtime_addShutdownHook_A06$T02 // expected:<0> but was:<1> - .put("lang.Runtime.execLjava_lang_String$Ljava_lang_String.Runtime_exec_A03", any()) + .put("lang.Runtime.execLjava_lang_String_Ljava_lang_String.Runtime_exec_A03", any()) // 1) t01 // java.lang.AssertionError: expected:<0> but was:<1> - .put("lang.Runtime.execLjava_lang_String$Ljava_lang_String.Runtime_exec_A02", any()) + .put("lang.Runtime.execLjava_lang_String_Ljava_lang_String.Runtime_exec_A02", any()) // 1) t01 // org.junit.ComparisonFailure: expected:<[t01]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoEnv // ]> // 2) t02 - // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.execLjava_lang_String$Ljava_lang_String.Runtime_exec_A02$T02 + // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.execLjava_lang_String_Ljava_lang_String.Runtime_exec_A02$T02 // ]> - .put("lang.Runtime.execLjava_lang_String$Ljava_lang_String.Runtime_exec_A01", any()) + .put("lang.Runtime.execLjava_lang_String_Ljava_lang_String.Runtime_exec_A01", any()) // 1) t01 // org.junit.ComparisonFailure: expected:<[com google jctf test lib java lang Runtime]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoArgs // ]> @@ -1434,7 +1434,7 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Bad exit code of spawned java proccess, err=Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.removeShutdownHookLjava_lang_Thread.Runtime_removeShutdownHook_A02$T02 // expected:<0> but was:<1> - .put("lang.Runtime.exec$Ljava_lang_String$Ljava_lang_String.Runtime_exec_A01", any()) + .put("lang.Runtime.exec_Ljava_lang_String_Ljava_lang_String.Runtime_exec_A01", any()) // 1) t01 // org.junit.ComparisonFailure: expected:<[com google jctf test lib java lang Runtime]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoArgs // ]> @@ -1444,12 +1444,12 @@ public class JctfTestSpecifications { // 1) t01 // java.lang.SecurityException - .put("lang.Runtime.exec$Ljava_lang_String$Ljava_lang_String.Runtime_exec_A02", any()) + .put("lang.Runtime.exec_Ljava_lang_String_Ljava_lang_String.Runtime_exec_A02", any()) // 1) t01 // org.junit.ComparisonFailure: expected:<[t01]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoEnv // ]> // 2) t02 - // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.exec$Ljava_lang_String$Ljava_lang_String.Runtime_exec_A02$T02 + // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.exec_Ljava_lang_String$Ljava_lang_String.Runtime_exec_A02$T02 // ]> .put("lang.Runtime.removeShutdownHookLjava_lang_Thread.Runtime_removeShutdownHook_A03", @@ -1459,24 +1459,24 @@ public class JctfTestSpecifications { // expected:<0> but was:<1> .put( - "lang.Runtime.exec$Ljava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A01", + "lang.Runtime.exec_Ljava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A01", any()) // 1) t01 // java.lang.AssertionError: actual=Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoArgs // : array lengths differed, expected.length=8 actual.length=9 - .put("lang.Runtime.exec$Ljava_lang_String$Ljava_lang_String.Runtime_exec_A03", any()) + .put("lang.Runtime.exec_Ljava_lang_String_Ljava_lang_String.Runtime_exec_A03", any()) // 1) t01 // java.lang.AssertionError: expected:<0> but was:<1> .put( - "lang.Runtime.exec$Ljava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A02", + "lang.Runtime.exec_Ljava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A02", any()) // 1) t01 // org.junit.ComparisonFailure: expected:<[t01]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoEnv // ]> // 2) t02 - // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.exec$Ljava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A02$T02 + // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.exec_Ljava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A02$T02 // ]> .put("lang.Runtime.haltI.Runtime_halt_A02", any()) @@ -1488,7 +1488,7 @@ public class JctfTestSpecifications { // expected:<0> but was:<1> .put( - "lang.Runtime.exec$Ljava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A03", + "lang.Runtime.exec_Ljava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A03", any()) // 1) t02 // java.lang.AssertionError: expected:<0> but was:<1> @@ -1541,12 +1541,12 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Bad exit code of spawned java proccess, err=Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.runFinalizersOnExitZ.Runtime_runFinalizersOnExit_A03$T03 // expected:<0> but was:<1> - .put("lang.Runtime.execLjava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A03", + .put("lang.Runtime.execLjava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A03", any()) // 1) t02 // java.lang.AssertionError: expected:<0> but was:<1> - .put("lang.Runtime.execLjava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A01", + .put("lang.Runtime.execLjava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A01", any()) // 1) t01 // org.junit.ComparisonFailure: expected:<[com google jctf test lib java lang Runtime]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoArgs @@ -1568,13 +1568,13 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Process did not block but exited with code 1; // err=Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.exitI.Runtime_exit_A03$T03 - .put("lang.Runtime.execLjava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A02", + .put("lang.Runtime.execLjava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A02", any()) // 1) t01 // org.junit.ComparisonFailure: expected:<[t01]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.EchoEnv // ]> // 2) t02 - // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.execLjava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A02$T02 + // org.junit.ComparisonFailure: expected:<[t02]> but was:<[Error: Could not find or load main class com.google.jctf.test.lib.java.lang.Runtime.execLjava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A02$T02 // ]> .put("lang.Runtime.exitI.Runtime_exit_A04", any()) @@ -2178,7 +2178,7 @@ public class JctfTestSpecifications { // 2) t02 // java.lang.UnsupportedOperationException - .put("lang.ThreadGroup.enumerate$Thread.ThreadGroup_enumerate_A01", any()) + .put("lang.ThreadGroup.enumerate_Thread.ThreadGroup_enumerate_A01", any()) // 1) t05 // java.lang.UnsupportedOperationException @@ -2200,7 +2200,7 @@ public class JctfTestSpecifications { // 1) t01 // java.lang.SecurityException - .put("lang.ThreadGroup.enumerate$ThreadZ.ThreadGroup_enumerate_A01", any()) + .put("lang.ThreadGroup.enumerate_ThreadZ.ThreadGroup_enumerate_A01", any()) // 1) t06 // java.lang.UnsupportedOperationException @@ -2299,7 +2299,7 @@ public class JctfTestSpecifications { // 6) t07 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.Class.getConstructor$Ljava_lang_Class.Class_getConstructor_A03", any()) + .put("lang.Class.getConstructor_Ljava_lang_Class.Class_getConstructor_A03", any()) // 1) t03 // java.lang.AssertionError: Vague error message @@ -2324,7 +2324,7 @@ public class JctfTestSpecifications { // java.lang.ClassNotFoundException: [[[Lcom.google.jctf.test.lib.java.lang.Class.forNameLjava_lang_StringZLjava_lang_ClassLoader.Class_forName_A01$TestFixture; // Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference - .put("lang.Class.getConstructor$Ljava_lang_Class.Class_getConstructor_A04", any()) + .put("lang.Class.getConstructor_Ljava_lang_Class.Class_getConstructor_A04", any()) // 1) t01 // java.lang.SecurityException // 2) t03 @@ -2347,7 +2347,7 @@ public class JctfTestSpecifications { // java.lang.SecurityException .put( - "lang.Class.getDeclaredMethodLjava_lang_String$Ljava_lang_Class.Class_getDeclaredMethod_A05", + "lang.Class.getDeclaredMethodLjava_lang_String_Ljava_lang_Class.Class_getDeclaredMethod_A05", any()) // 1) t01 // java.lang.SecurityException @@ -2365,7 +2365,7 @@ public class JctfTestSpecifications { // java.lang.SecurityException .put( - "lang.Class.getDeclaredMethodLjava_lang_String$Ljava_lang_Class.Class_getDeclaredMethod_A03", + "lang.Class.getDeclaredMethodLjava_lang_String_Ljava_lang_Class.Class_getDeclaredMethod_A03", any()) // 1) t05 // java.lang.AssertionError: Vague error message @@ -2546,10 +2546,10 @@ public class JctfTestSpecifications { // java.lang.NoClassDefFoundError: sun.security.jca.Providers // Caused by: java.lang.AssertionError: Unable to configure default providers - .put("lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A01", + .put("lang.Class.getMethodLjava_lang_String_Ljava_lang_Class.Class_getMethod_A01", match(runtimes(DexVm.ART_DEFAULT, DexVm.ART_7_0_0))) // 1) t04 - // java.lang.AssertionError: expected:<interface com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A01$I1> but was:<interface com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A01$I2> + // java.lang.AssertionError: expected:<interface com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String_Ljava_lang_Class.Class_getMethod_A01$I1> but was:<interface com.google.jctf.test.lib.java.lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A01$I2> .put("lang.Class.getGenericSuperclass.Class_getGenericSuperclass_A01", any()) // 1) t03 @@ -2570,12 +2570,12 @@ public class JctfTestSpecifications { // java.lang.SecurityException .put( - "lang.Class.getDeclaredConstructor$Ljava_lang_Class.Class_getDeclaredConstructor_A02", + "lang.Class.getDeclaredConstructor_Ljava_lang_Class.Class_getDeclaredConstructor_A02", any()) // 1) t03 // java.lang.AssertionError: Vague error message - .put("lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A05", any()) + .put("lang.Class.getMethodLjava_lang_String_Ljava_lang_Class.Class_getMethod_A05", any()) // 1) t01 // java.lang.SecurityException // 2) t03 @@ -2590,7 +2590,7 @@ public class JctfTestSpecifications { // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference .put( - "lang.Class.getDeclaredConstructor$Ljava_lang_Class.Class_getDeclaredConstructor_A03", + "lang.Class.getDeclaredConstructor_Ljava_lang_Class.Class_getDeclaredConstructor_A03", any()) // 1) t01 // java.lang.SecurityException @@ -2599,7 +2599,7 @@ public class JctfTestSpecifications { // 3) t04 // java.lang.SecurityException - .put("lang.Class.getMethodLjava_lang_String$Ljava_lang_Class.Class_getMethod_A03", any()) + .put("lang.Class.getMethodLjava_lang_String_Ljava_lang_Class.Class_getMethod_A03", any()) // 1) t03 // java.lang.AssertionError: Vague error message @@ -2648,7 +2648,7 @@ public class JctfTestSpecifications { // 1) t09 // org.junit.ComparisonFailure: Incorrect double string returned expected:<0.001[0]> but was:<0.001[]> - .put("lang.String.Constructor$BLjava_nio_charset_Charset.String_Constructor_A01", any()) + .put("lang.String.Constructor_BLjava_nio_charset_Charset.String_Constructor_A01", any()) // 1) t02 // org.junit.ComparisonFailure: expected:<�[]> but was:<�[�]> // 2) t03 @@ -2701,13 +2701,13 @@ public class JctfTestSpecifications { // 1) t06 // java.lang.AssertionError: array lengths differed, expected.length=1 actual.length=2 - .put("lang.String.getBytesII$BI.String_getBytes_A03", any()) + .put("lang.String.getBytesII_BI.String_getBytes_A03", any()) // 1) t04 // java.lang.AssertionError: Should throws IndexOutOfBoundsException: 0 // 2) t05 // java.lang.AssertionError: Should throws IndexOutOfBoundsException: 0 - .put("lang.String.getBytesII$BI.String_getBytes_A02", any()) + .put("lang.String.getBytesII_BI.String_getBytes_A02", any()) // 1) t01 // java.lang.AssertionError: Expected exception: java.lang.NullPointerException @@ -2715,7 +2715,7 @@ public class JctfTestSpecifications { // 1) t02 // org.junit.ComparisonFailure: expected:<i[]> but was:<i[̇]> - .put("lang.String.Constructor$BIILjava_nio_charset_Charset.String_Constructor_A01", any()) + .put("lang.String.Constructor_BIILjava_nio_charset_Charset.String_Constructor_A01", any()) // 1) t02 // org.junit.ComparisonFailure: expected:<�[]> but was:<�[�]> // 2) t03 @@ -3609,7 +3609,7 @@ public class JctfTestSpecifications { // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference .put( - "lang.reflect.Proxy.getProxyClassLjava_lang_ClassLoader$Ljava_lang_Class.Proxy_getProxyClass_A01", + "lang.reflect.Proxy.getProxyClassLjava_lang_ClassLoader_Ljava_lang_Class.Proxy_getProxyClass_A01", any()) // 1) t01 // java.lang.AssertionError: expected same:<null> was not:<java.lang.BootClassLoader@ecc20b9> @@ -3617,7 +3617,7 @@ public class JctfTestSpecifications { // java.lang.AssertionError: expected same:<null> was not:<java.lang.BootClassLoader@ecc20b9> .put( - "lang.reflect.Proxy.getProxyClassLjava_lang_ClassLoader$Ljava_lang_Class.Proxy_getProxyClass_A03", + "lang.reflect.Proxy.getProxyClassLjava_lang_ClassLoader_Ljava_lang_Class.Proxy_getProxyClass_A03", any()) // 1) t03 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -3648,7 +3648,7 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Failed to load serialization resource file: serialization/com/google/jctf/test/lib/java/lang/reflect/GenericSignatureFormatError/serialization/GenericSignatureFormatError_serialization_A01.golden.0.ser .put( - "lang.reflect.Proxy.newProxyInstanceLjava_lang_ClassLoader$Ljava_lang_ClassLjava_lang_reflect_InvocationHandler.Proxy_newProxyInstance_A02", + "lang.reflect.Proxy.newProxyInstanceLjava_lang_ClassLoader_Ljava_lang_ClassLjava_lang_reflect_InvocationHandler.Proxy_newProxyInstance_A02", any()) // 1) t03 // java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.available()' on a null object reference @@ -3660,7 +3660,7 @@ public class JctfTestSpecifications { // java.lang.NullPointerException .put( - "lang.reflect.Proxy.newProxyInstanceLjava_lang_ClassLoader$Ljava_lang_ClassLjava_lang_reflect_InvocationHandler.Proxy_newProxyInstance_A01", + "lang.reflect.Proxy.newProxyInstanceLjava_lang_ClassLoader_Ljava_lang_ClassLjava_lang_reflect_InvocationHandler.Proxy_newProxyInstance_A01", any()) // 1) t01 // java.lang.AssertionError: Bad classloader expected:<null> but was:<java.lang.BootClassLoader@fda9ca7> @@ -3719,7 +3719,7 @@ public class JctfTestSpecifications { // java.lang.ClassNotFoundException: com.google.jctf.test.lib.java.lang.reflect.Method.getGenericExceptionTypes.Method_getGenericExceptionTypes_A01$Fourth // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.reflect.Method.getGenericExceptionTypes.Method_getGenericExceptionTypes_A01$Fourth" on path: DexPathList[[dex file "/tmp/junit8600081041276641493/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] - .put("lang.reflect.Method.invokeLjava_lang_Object$Ljava_lang_Object.Method_invoke_A07", + .put("lang.reflect.Method.invokeLjava_lang_Object_Ljava_lang_Object.Method_invoke_A07", any()) // 1) t01 // java.lang.AssertionError: Expected exception: java.lang.IllegalAccessException @@ -3772,7 +3772,7 @@ public class JctfTestSpecifications { // Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.jctf.test.lib.java.lang.reflect.Method.MissingParameterTypeMethod" on path: DexPathList[[dex file "/tmp/junit3534060116722105133/classes.dex"],nativeLibraryDirectories=[r8/tools/linux/art/bin/../lib, r8/tools/linux/art/bin/../lib]] .put( - "lang.reflect.InvocationHandler.invokeLjava_lang_ObjectLjava_lang_reflect_Method$Ljava_lang_Object.InvocationHandler_invoke_A02", + "lang.reflect.InvocationHandler.invokeLjava_lang_ObjectLjava_lang_reflect_Method_Ljava_lang_Object.InvocationHandler_invoke_A02", any()) // 1) t04 // java.lang.AssertionError: ClassCastException should be thrown @@ -4005,7 +4005,7 @@ public class JctfTestSpecifications { // 1) t02 // java.lang.AssertionError: Exception is not thrown: field: shortPublicField, object: com.google.jctf.test.lib.java.lang.reflect.Field.TestStaticFinalPrimitiveField@bf7ecde - .put("lang.reflect.Constructor.newInstance$Ljava_lang_Object.Constructor_newInstance_A06", + .put("lang.reflect.Constructor.newInstance_Ljava_lang_Object.Constructor_newInstance_A06", any()) // 1) t05 // java.lang.AssertionError: Expected exception: java.lang.IllegalArgumentException @@ -4125,7 +4125,7 @@ public class JctfTestSpecifications { // java.lang.SecurityException .put( - "lang.reflect.AccessibleObject.setAccessible$Ljava_lang_reflect_AccessibleObjectZ.AccessibleObject_setAccessible_A03", + "lang.reflect.AccessibleObject.setAccessible_Ljava_lang_reflect_AccessibleObjectZ.AccessibleObject_setAccessible_A03", any()) // 1) t01 // java.lang.SecurityException @@ -4139,7 +4139,7 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Misconfiguration: MissingAntn should not be accessible .put( - "lang.reflect.AccessibleObject.setAccessible$Ljava_lang_reflect_AccessibleObjectZ.AccessibleObject_setAccessible_A02", + "lang.reflect.AccessibleObject.setAccessible_Ljava_lang_reflect_AccessibleObjectZ.AccessibleObject_setAccessible_A02", any()) // 1) t01 // java.lang.SecurityException @@ -4452,7 +4452,7 @@ public class JctfTestSpecifications { // 2) t02(com.google.jctf.test.lib.java.util.concurrent.CopyOnWriteArrayList.lastIndexOfLjava_lang_ObjectI.CopyOnWriteArrayList_lastIndexOf_A01) // java.lang.ArrayIndexOutOfBoundsException: length=3; index=2147483647 - .put("lang.StringBuffer.getCharsII$CI.StringBuffer_getChars_A03", + .put("lang.StringBuffer.getCharsII_CI.StringBuffer_getChars_A03", match(runtimes(DexVm.ART_6_0_1, DexVm.ART_5_1_1))) // 1) t03 // java.lang.NullPointerException: dst == null @@ -4462,7 +4462,7 @@ public class JctfTestSpecifications { // 1) t02 // java.lang.AssertionError: Buffer is invalid length after append expected:<26> but was:<25> - .put("lang.StringBuffer.insertI$CII.StringBuffer_insert_A02", + .put("lang.StringBuffer.insertI_CII.StringBuffer_insert_A02", match(runtimes(DexVm.ART_6_0_1, DexVm.ART_5_1_1))) // 1) t01 // java.lang.NullPointerException: Attempt to get length of null array @@ -4623,7 +4623,7 @@ public class JctfTestSpecifications { // java.lang.AssertionError: Invalid length of created builder expected:<14> but was:<13> .put( - "lang.reflect.AccessibleObject.setAccessible$Ljava_lang_reflect_AccessibleObjectZ.AccessibleObject_setAccessible_A04", + "lang.reflect.AccessibleObject.setAccessible_Ljava_lang_reflect_AccessibleObjectZ.AccessibleObject_setAccessible_A04", match(runtimes(DexVm.ART_6_0_1, DexVm.ART_5_1_1))) // 1) t01 // java.lang.AssertionError: SecurityException expected. @@ -4745,34 +4745,34 @@ public class JctfTestSpecifications { any()) .put("lang.Thread.setPriorityI.Thread_setPriority_A02", any()) .put("lang.Thread.stopLjava_lang_Throwable.Thread_stop_A02", any()) - .put("lang.Runtime.execLjava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A04", + .put("lang.Runtime.execLjava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A04", any()) .put("lang.Thread.getContextClassLoader.Thread_getContextClassLoader_A02", any()) .put("lang.ThreadGroup.suspend.ThreadGroup_suspend_A02", any()) .put("lang.Thread.setDaemonZ.Thread_setDaemon_A03", any()) .put("lang.ProcessBuilder.environment.ProcessBuilder_environment_A07", any()) .put( - "lang.Runtime.exec$Ljava_lang_String$Ljava_lang_StringLjava_io_File.Runtime_exec_A04", + "lang.Runtime.exec_Ljava_lang_String_Ljava_lang_StringLjava_io_File.Runtime_exec_A04", any()) - .put("lang.Runtime.execLjava_lang_String$Ljava_lang_String.Runtime_exec_A04", any()) - .put("lang.Runtime.exec$Ljava_lang_String.Runtime_exec_A04", any()) + .put("lang.Runtime.execLjava_lang_String_Ljava_lang_String.Runtime_exec_A04", any()) + .put("lang.Runtime.exec_Ljava_lang_String.Runtime_exec_A04", any()) .put("lang.Runtime.execLjava_lang_String.Runtime_exec_A04", any()) .put("lang.System.clearPropertyLjava_lang_String.System_clearProperty_A03", any()) .put("lang.System.getSecurityManager.System_getSecurityManager_A01", any()) .put("lang.System.setInLjava_io_InputStream.System_setIn_A02", any()) .put("lang.System.setOutLjava_io_PrintStream.System_setOut_A02", any()) .put("lang.ThreadGroup.destroy.ThreadGroup_destroy_A04", any()) - .put("lang.ThreadGroup.enumerate$ThreadGroupZ.ThreadGroup_enumerate_A03", any()) - .put("lang.ThreadGroup.enumerate$Thread.ThreadGroup_enumerate_A03", any()) - .put("lang.ThreadGroup.enumerate$ThreadZ.ThreadGroup_enumerate_A03", any()) + .put("lang.ThreadGroup.enumerate_ThreadGroupZ.ThreadGroup_enumerate_A03", any()) + .put("lang.ThreadGroup.enumerate_Thread.ThreadGroup_enumerate_A03", any()) + .put("lang.ThreadGroup.enumerate_ThreadZ.ThreadGroup_enumerate_A03", any()) .put("lang.ThreadGroup.interrupt.ThreadGroup_interrupt_A02", any()) .put("lang.ThreadGroup.resume.ThreadGroup_resume_A02", any()) .put("lang.ThreadGroup.setMaxPriorityI.ThreadGroup_setMaxPriority_A02", any()) - .put("lang.Runtime.exec$Ljava_lang_String$Ljava_lang_String.Runtime_exec_A04", any()) + .put("lang.Runtime.exec_Ljava_lang_String_Ljava_lang_String.Runtime_exec_A04", any()) .put("lang.System.getenvLjava_lang_String.System_getenv_A03", any()) .put("lang.System.setPropertyLjava_lang_StringLjava_lang_String.System_setProperty_A02", any()) - .put("lang.ThreadGroup.enumerate$ThreadGroup.ThreadGroup_enumerate_A03", any()) + .put("lang.ThreadGroup.enumerate_ThreadGroup.ThreadGroup_enumerate_A03", any()) .put("lang.ThreadGroup.getParent.ThreadGroup_getParent_A02", any()) .put("lang.ThreadGroup.setDaemonZ.ThreadGroup_setDaemon_A02", any()) .put("lang.ThreadGroup.stop.ThreadGroup_stop_A02", any()) diff --git a/src/test/java/com/android/tools/r8/compatdx/CompatDxTests.java b/src/test/java/com/android/tools/r8/compatdx/CompatDxTests.java index b3d31c54c..5af5c0c1d 100644 --- a/src/test/java/com/android/tools/r8/compatdx/CompatDxTests.java +++ b/src/test/java/com/android/tools/r8/compatdx/CompatDxTests.java @@ -100,10 +100,21 @@ public class CompatDxTests { } @Test + public void singleDexProgramFull() throws IOException, ExecutionException { + // Generate an application that fills the whole dex file. + AndroidApp generated = + MainDexListTests.generateApplication( + ImmutableList.of("A"), Constants.ANDROID_L_API, Constants.U16BIT_MAX + 1); + Path applicationJar = temp.newFile("application.jar").toPath(); + generated.write(applicationJar, OutputMode.Indexed); + runDexer(applicationJar.toString()); + } + + @Test public void singleDexProgramIsTooLarge() throws IOException, ExecutionException { // Generate an application that will not fit into a single dex file. AndroidApp generated = MainDexListTests.generateApplication( - ImmutableList.of("A", "B"), Constants.ANDROID_L_API, Constants.U16BIT_MAX / 2 + 1); + ImmutableList.of("A", "B"), Constants.ANDROID_L_API, Constants.U16BIT_MAX / 2 + 2); Path applicationJar = temp.newFile("application.jar").toPath(); generated.write(applicationJar, OutputMode.Indexed); thrown.expect(CompilationError.class); diff --git a/src/test/java/com/android/tools/r8/ir/deterministic/DeterministicProcessingTest.java b/src/test/java/com/android/tools/r8/ir/deterministic/DeterministicProcessingTest.java index 6acacdaee..d5f70cce6 100644 --- a/src/test/java/com/android/tools/r8/ir/deterministic/DeterministicProcessingTest.java +++ b/src/test/java/com/android/tools/r8/ir/deterministic/DeterministicProcessingTest.java @@ -70,7 +70,7 @@ public class DeterministicProcessingTest extends SmaliTestBase { public List<DexEncodedMethod> permutationsOfTwo( List<DexEncodedMethod> methods, CallGraph.Leaves leaves) { - if (!leaves.brokeCycles()) { + if (!leaves.hasBrokeCycles()) { return methods; } methods.sort(Comparator.comparing(DexEncodedMethod::qualifiedName)); diff --git a/src/test/java/com/android/tools/r8/utils/D8CommandTest.java b/src/test/java/com/android/tools/r8/utils/D8CommandTest.java index 2844a22de..1db48c4fc 100644 --- a/src/test/java/com/android/tools/r8/utils/D8CommandTest.java +++ b/src/test/java/com/android/tools/r8/utils/D8CommandTest.java @@ -163,6 +163,12 @@ public class D8CommandTest { parse("--output", invalidType.toString()); } + @Test + public void nonExistingOutputJar() throws Throwable { + Path nonExistingJar = temp.getRoot().toPath().resolve("non-existing-archive.jar"); + D8Command.builder().setOutputPath(nonExistingJar).build(); + } + private D8Command parse(String... args) throws IOException, CompilationException { return D8Command.parse(args).build(); } diff --git a/src/test/java/com/android/tools/r8/utils/OutputModeTest.java b/src/test/java/com/android/tools/r8/utils/OutputModeTest.java new file mode 100644 index 000000000..5929b6073 --- /dev/null +++ b/src/test/java/com/android/tools/r8/utils/OutputModeTest.java @@ -0,0 +1,34 @@ +// Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +package com.android.tools.r8.utils; + +import static org.junit.Assert.assertEquals; + +import com.android.tools.r8.Resource; +import java.util.Collections; +import org.junit.Test; + +public class OutputModeTest { + @Test + public void testIndexedFileName() { + assertEquals("classes.dex", OutputMode.Indexed.getOutputPath(null, 0)); + assertEquals("classes2.dex", OutputMode.Indexed.getOutputPath(null, 1)); + } + + @Test + public void testFilePerClass() { + Resource test = + Resource.fromBytes(Resource.Kind.CLASSFILE, new byte[]{}, Collections.singleton("LTest;")); + assertEquals("Test.dex", OutputMode.FilePerClass.getOutputPath(test, 0)); + Resource comTest = + Resource.fromBytes( + Resource.Kind.CLASSFILE, new byte[]{}, Collections.singleton("Lcom/Test;")); + assertEquals("com/Test.dex", OutputMode.FilePerClass.getOutputPath(comTest, 0)); + Resource comExampleTest = + Resource.fromBytes( + Resource.Kind.CLASSFILE, new byte[]{}, Collections.singleton("Lcom/example/Test;")); + assertEquals("com/example/Test.dex", OutputMode.FilePerClass.getOutputPath(comExampleTest, 0)); + assertEquals("com/example/Test.dex", OutputMode.FilePerClass.getOutputPath(comExampleTest, 1)); + } +} diff --git a/src/test/java/com/android/tools/r8/utils/R8CommandTest.java b/src/test/java/com/android/tools/r8/utils/R8CommandTest.java index ed38b888a..2af79cbcf 100644 --- a/src/test/java/com/android/tools/r8/utils/R8CommandTest.java +++ b/src/test/java/com/android/tools/r8/utils/R8CommandTest.java @@ -184,6 +184,12 @@ public class R8CommandTest { assertEquals(1, ToolHelper.getApp(command).getDexProgramResources().size()); } + @Test + public void nonExistingOutputJar() throws Throwable { + Path nonExistingJar = temp.getRoot().toPath().resolve("non-existing-archive.jar"); + R8Command.builder().setOutputPath(nonExistingJar).build(); + } + private R8Command parse(String... args) throws CompilationException, ProguardRuleParserException, IOException { return R8Command.parse(args).build(); diff --git a/third_party/gradle/gradle.tar.gz.sha1 b/third_party/gradle/gradle.tar.gz.sha1 index 60fe88df5..008d84c90 100644 --- a/third_party/gradle/gradle.tar.gz.sha1 +++ b/third_party/gradle/gradle.tar.gz.sha1 @@ -1 +1 @@ -6d7736db6f3f9c2dbe57e1ea6b36a1f694b9feef +1d118f48ff995b7eca95f3655293ea959779a6c0
\ No newline at end of file diff --git a/third_party/jctf.tar.gz.sha1 b/third_party/jctf.tar.gz.sha1 index 35ec1ba1e..41e1ea9dd 100644 --- a/third_party/jctf.tar.gz.sha1 +++ b/third_party/jctf.tar.gz.sha1 @@ -1 +1 @@ -93c13a164ca54db72273642d27308e325526fd38
\ No newline at end of file +d824506dedb8cb186a13d2fd45aae349ce86bcad
\ No newline at end of file diff --git a/tools/proguard.py b/tools/proguard.py index 58c049f9e..efcf560d2 100755 --- a/tools/proguard.py +++ b/tools/proguard.py @@ -15,10 +15,13 @@ import utils PROGUARD_JAR = os.path.join(utils.REPO_ROOT, 'third_party', 'proguard', 'proguard_internal_159423826', 'ProGuard_deploy.jar') -def run(args): - cmd = ['java', '-jar', PROGUARD_JAR] +def run(args, track_memory_file = None): + cmd = [] + if track_memory_file: + cmd.extend(['tools/track_memory.sh', track_memory_file]) + cmd.extend(['java', '-jar', PROGUARD_JAR]) cmd.extend(args) - print('-- ' + ' '.join(cmd)) + utils.PrintCmd(cmd) subprocess.check_call(cmd) def Main(): diff --git a/tools/run_on_app.py b/tools/run_on_app.py index f3cc9b5ca..d7db7fb16 100755 --- a/tools/run_on_app.py +++ b/tools/run_on_app.py @@ -3,6 +3,7 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. +from __future__ import print_function import optparse import os import sys @@ -55,8 +56,11 @@ def ParseOptions(): 'If passing several options use a quoted string.') result.add_option('--r8-flags', help='Additional option(s) for the compiler. ' + - 'Same as --compiler-flags, keeping it for backward compatibility. ' + + 'Same as --compiler-flags, keeping it for backward' + ' compatibility. ' + 'If passing several options use a quoted string.') + # TODO(tamaskenez) remove track-memory-to-file as soon as we updated golem + # to use --print-memoryuse instead result.add_option('--track-memory-to-file', help='Track how much memory the jvm is using while ' + ' compiling. Output to the specified file.') @@ -73,6 +77,11 @@ def ParseOptions(): help='Prints the line \'<BENCHMARKNAME>(RunTimeRaw):' + ' <elapsed> ms\' at the end where <elapsed> is' + ' the elapsed time in milliseconds.') + result.add_option('--print-memoryuse', + metavar='BENCHMARKNAME', + help='Prints the line \'<BENCHMARKNAME>(MemoryUse):' + + ' <mem>\' at the end where <mem> is the peak' + + ' peak resident set size (VmHWM) in bytes.') return result.parse_args() # Most apps have the -printmapping and -printseeds in the Proguard @@ -81,10 +90,10 @@ def ParseOptions(): # placing these two output files together with the dex output. def GenerateAdditionalProguardConfiguration(temp, outdir): name = "output.config" - with open(os.path.join(temp, name), 'w') as file: - file.write('-printmapping ' + os.path.join(outdir, 'proguard.map') + "\n") - file.write('-printseeds ' + os.path.join(outdir, 'proguard.seeds') + "\n") - return os.path.abspath(file.name) + with open(os.path.join(temp, name), 'w') as f: + f.write('-printmapping ' + os.path.join(outdir, 'proguard.map') + "\n") + f.write('-printseeds ' + os.path.join(outdir, 'proguard.seeds') + "\n") + return os.path.abspath(f.name) def main(): app_provided_pg_conf = False; @@ -104,8 +113,9 @@ def main(): raise 'Unexpected' if not options.version in data.VERSIONS.keys(): - print 'No version %s for application %s' % (options.version, options.app) - print 'Valid versions are %s' % data.VERSIONS.keys() + print('No version {} for application {}' + .format(options.version, options.app)) + print('Valid versions are {}'.format(data.VERSIONS.keys())) return 1 version = data.VERSIONS[options.version] @@ -115,13 +125,15 @@ def main(): else 'proguarded' if options.type not in version: - print 'No type %s for version %s' % (options.type, options.version) - print 'Valid types are %s' % version.keys() + print('No type {} for version {}'.format(options.type, options.version)) + print('Valid types are {}'.format(version.keys())) return 1 values = version[options.type] inputs = None - # For R8 'deploy' the JAR is located using the Proguard configuration -injars option. - if 'inputs' in values and (options.compiler != 'r8' or options.type != 'deploy'): + # For R8 'deploy' the JAR is located using the Proguard configuration + # -injars option. + if 'inputs' in values and (options.compiler != 'r8' + or options.type != 'deploy'): inputs = values['inputs'] args.extend(['--output', outdir]) @@ -145,7 +157,8 @@ def main(): for lib in values['libraries']: args.extend(['--lib', lib]) - if not outdir.endswith('.zip') and not outdir.endswith('.jar') and not os.path.exists(outdir): + if not outdir.endswith('.zip') and not outdir.endswith('.jar') \ + and not os.path.exists(outdir): os.makedirs(outdir) if options.compiler == 'r8': @@ -161,16 +174,18 @@ def main(): args.extend(inputs) t0 = time.time() - if options.dump_args_file: with open(options.dump_args_file, 'w') as args_file: args_file.writelines([arg + os.linesep for arg in args]) else: - if options.compiler == 'd8': - d8.run(args, not options.no_build, not options.no_debug, options.profile, - options.track_memory_to_file) - else: - with utils.TempDir() as temp: + with utils.TempDir() as temp: + if options.print_memoryuse and not options.track_memory_to_file: + options.track_memory_to_file = os.path.join(temp, + utils.MEMORY_USE_TMP_FILE) + if options.compiler == 'd8': + d8.run(args, not options.no_build, not options.no_debug, + options.profile, options.track_memory_to_file) + else: if app_provided_pg_conf: # Ensure that output of -printmapping and -printseeds go to the output # location and not where the app Proguard configuration places them. @@ -181,8 +196,12 @@ def main(): additional_pg_conf = GenerateAdditionalProguardConfiguration( temp, os.path.abspath(pg_outdir)) args.extend(['--pg-conf', additional_pg_conf]) - r8.run(args, not options.no_build, not options.no_debug, options.profile, - options.track_memory_to_file) + r8.run(args, not options.no_build, not options.no_debug, + options.profile, options.track_memory_to_file) + if options.print_memoryuse: + print('{}(MemoryUse): {}' + .format(options.print_memoryuse, + utils.grep_memoryuse(options.track_memory_to_file))) if options.print_runtimeraw: print('{}(RunTimeRaw): {} ms' diff --git a/tools/run_proguard_dx_on_gmscore.py b/tools/run_proguard_dx_on_gmscore.py index ca0b5e9e9..de716b082 100755 --- a/tools/run_proguard_dx_on_gmscore.py +++ b/tools/run_proguard_dx_on_gmscore.py @@ -40,6 +40,11 @@ def parse_arguments(): help = 'Prints the line \'<BENCHMARKNAME>(RunTimeRaw): <elapsed>' + ' ms\' at the end where <elapsed> is the elapsed time in' + ' milliseconds.') + parser.add_argument('--print-memoryuse', + metavar='BENCHMARKNAME', + help='Prints the line \'<BENCHMARKNAME>(MemoryUse):' + + ' <mem>\' at the end where <mem> is the peak' + + ' peak resident set size (VmHWM) in bytes.') parser.add_argument('--compatdx', help = 'Use CompatDx (D8) instead of DX.', default = False, @@ -72,7 +77,15 @@ def Main(): t0 = time.time() - proguard.run(args) + proguard_memoryuse = None + + with utils.TempDir() as temp: + track_memory_file = None + if options.print_memoryuse: + track_memory_file = join(temp, utils.MEMORY_USE_TMP_FILE) + proguard.run(args, track_memory_file = track_memory_file) + if options.print_memoryuse: + proguard_memoryuse = utils.grep_memoryuse(track_memory_file) # run dex on the result if options.compatdx: @@ -80,10 +93,21 @@ def Main(): else: jar = DX_JAR - cmd = ['java', '-jar', jar, '--min-sdk-version=26', '--multi-dex', - '--output=' + outdir, '--dex', PROGUARDED_OUTPUT]; - utils.PrintCmd(cmd); - check_call(cmd) + with utils.TempDir() as temp: + track_memory_file = None + cmd = [] + if options.print_memoryuse: + track_memory_file = join(temp, utils.MEMORY_USE_TMP_FILE) + cmd.extend(['tools/track_memory.sh', track_memory_file]) + cmd.extend(['java', '-jar', jar, '--min-sdk-version=26', '--multi-dex', + '--output=' + outdir, '--dex', PROGUARDED_OUTPUT]); + utils.PrintCmd(cmd); + check_call(cmd) + if options.print_memoryuse: + dx_memoryuse = utils.grep_memoryuse(track_memory_file) + print('{}(MemoryUse): {}' + .format(options.print_memoryuse, + max(proguard_memoryuse, dx_memoryuse))) if options.print_runtimeraw: print('{}(RunTimeRaw): {} ms' diff --git a/tools/test_framework.py b/tools/test_framework.py index 810935d18..57279bfb4 100755 --- a/tools/test_framework.py +++ b/tools/test_framework.py @@ -53,6 +53,12 @@ def parse_arguments(): required = True, help = 'Results will be printed using the specified benchmark name (e.g.' ' <NAME>-<segment>(CodeSize): <bytes>)') + parser.add_argument('--print-memoryuse', + help = 'Prints the line \'<NAME>(MemoryUse):' + + ' <mem>\' at the end where <mem> is the peak' + + ' peak resident set size (VmHWM) in bytes.', + default = False, + action = 'store_true') return parser.parse_args() # Return a dictionary: {segment_name -> segments_size} @@ -96,10 +102,16 @@ def Main(): if args.tool == 'd8-release': tool_args.append('--release') + + cmd = [] + + track_memory_file = None + if args.print_memoryuse: + track_memory_file = os.path.join(temp_dir, utils.MEMORY_USE_TMP_FILE) + cmd.extend(['tools/track_memory.sh', track_memory_file]) + if tool_file.endswith('.jar'): - cmd = ['java', '-jar'] - else: - cmd = [] + cmd.extend(['java', '-jar']) cmd.extend([tool_file] + tool_args + [FRAMEWORK_JAR]) @@ -109,6 +121,10 @@ def Main(): subprocess.check_call(cmd) dt = time.time() - t0 + if args.print_memoryuse: + print('{}(MemoryUse): {}' + .format(args.name, utils.grep_memoryuse(track_memory_file))) + dex_files = [f for f in glob(os.path.join(temp_dir, '*.dex'))] code_size = 0 for dex_file in dex_files: diff --git a/tools/utils.py b/tools/utils.py index fd7212bd7..2564adc2e 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -14,6 +14,7 @@ import tempfile TOOLS_DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..'))) REPO_ROOT = os.path.realpath(os.path.join(TOOLS_DIR, '..')) +MEMORY_USE_TMP_FILE = 'memory_use.tmp' def PrintCmd(s): if type(s) is list: @@ -118,3 +119,25 @@ def read_cts_test_result(file_xml): outcome = m.groups()[0] assert outcome in ['fail', 'pass'] yield CtsTest(m.groups()[1], outcome == 'pass') + +def grep_memoryuse(logfile): + re_vmhwm = re.compile('^VmHWM:[ \t]*([0-9]+)[ \t]*([a-zA-Z]*)') + result = None + with open(logfile) as f: + for line in f: + m = re_vmhwm.search(line) + if m: + groups = m.groups() + s = len(groups) + if s >= 1: + result = int(groups[0]) + if s >= 2: + unit = groups[1] + if unit == 'kB': + result *= 1024 + elif unit != '': + raise Exception('Unrecognized unit in memory usage log: {}' + .format(unit)) + if result is None: + raise Exception('No memory usage found in log: {}'.format(logfile)) + return result
\ No newline at end of file |