Mercurial > hg > graal-jvmci-8
changeset 22035:f368142e5631
Merge
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Fri, 19 Jun 2015 09:31:51 -0700 |
parents | 0cebd06508ca (current diff) 0eedd37f45ba (diff) |
children | 95c7ad0634c7 |
files | graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java graal/com.oracle.graal.test/src/com/oracle/graal/test/AnsiTerminalDecorator.java graal/com.oracle.graal.test/src/com/oracle/graal/test/EagerStackTraceDecorator.java graal/com.oracle.graal.test/src/com/oracle/graal/test/GCAfterTestDecorator.java graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalJUnitCore.java graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalJUnitRunListener.java graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalJUnitRunListenerDecorator.java graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalTextListener.java graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalVerboseTextListener.java graal/com.oracle.graal.test/src/com/oracle/graal/test/TimingDecorator.java mx/.project mx/.pydevproject mx/eclipse-settings/org.eclipse.core.resources.prefs mx/eclipse-settings/org.eclipse.jdt.apt.core.prefs mx/eclipse-settings/org.eclipse.jdt.core.prefs mx/eclipse-settings/org.eclipse.jdt.ui.prefs mx/mx_graal.py mx/mx_graal_makefile.py mx/outputparser.py mx/sanitycheck.py mx/suite.py |
diffstat | 65 files changed, 6928 insertions(+), 6503 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Fri Jun 19 09:28:25 2015 -0700 +++ b/.hgignore Fri Jun 19 09:31:51 2015 -0700 @@ -1,14 +1,3 @@ -^mx/env -^mx/checkstyle-timestamps -^mx/eclipse-config.zip -^mx/eclipse-config-libs.zip -^mx/netbeans-config.zip -^mx/netbeans-config-libs.zip -^mx/eclipse-launches -^mx/jmh -^mx/currentAnnotationProcessors -^mx/ecj.jar -^mx/includes ^build/ ^build-nograal/ ^build-nojvmci/ @@ -42,11 +31,6 @@ \.hprof$ \javafilelist.txt$ \.hprof\.txt$ -^graal/.*/build.xml -^jvmci/.*/build.xml -^graal/.*/nbproject/ -^jvmci/.*/nbproject/ -dist ^doc/.*/dot_temp_ ^doc/doxygen/.*$ \.orig$ @@ -76,7 +60,21 @@ .idea/ ^cscope.out ^tags + syntax: glob +currentAnnotationProcessors +ecj.jar +jmh +env +nbproject +dist +build.xml +checkstyle-timestamps +eclipse-config.zip +eclipse-config-libs.zip +netbeans-config.zip +netbeans-config-libs.zip +eclipse-launches *.bgv core.* *.jar
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MarkUnsafeAccessTest.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.compiler.test; + +import org.junit.*; + +import sun.misc.*; + +public class MarkUnsafeAccessTest extends GraalCompilerTest { + + public static Unsafe unsafe; + + public void getRaw() { + unsafe.getInt(0L); + } + + public void get() { + unsafe.getInt(null, 0L); + } + + public void putRaw() { + unsafe.putInt(0L, 0); + } + + public void put() { + unsafe.putInt(null, 0L, 0); + } + + public void cas() { + unsafe.compareAndSwapInt(null, 0, 0, 0); + } + + public void noAccess() { + unsafe.addressSize(); + unsafe.pageSize(); + } + + private void assertHasUnsafe(String name, boolean hasUnsafe) { + Assert.assertEquals(hasUnsafe, compile(getResolvedJavaMethod(name), null).hasUnsafeAccess()); + } + + @Test + public void testGet() { + assertHasUnsafe("get", true); + assertHasUnsafe("getRaw", true); + } + + @Test + public void testPut() { + assertHasUnsafe("put", true); + assertHasUnsafe("putRaw", true); + } + + @Test + public void testCas() { + assertHasUnsafe("cas", true); + } + + @Test + public void testNoAcces() { + assertHasUnsafe("noAccess", false); + } +}
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Fri Jun 19 09:31:51 2015 -0700 @@ -239,6 +239,7 @@ lirGen = emitLIR(backend, target, schedule, graph, stub, cc, registerConfig, lirSuites); try (Scope s2 = Debug.scope("CodeGen", lirGen, lirGen.getLIR())) { int bytecodeSize = graph.method() == null ? 0 : graph.getBytecodeSize(); + compilationResult.setHasUnsafeAccess(graph.hasUnsafeAccess()); emitCode(backend, graph.getAssumptions(), graph.method(), graph.getInlinedMethods(), bytecodeSize, lirGen, compilationResult, installedCodeOwner, factory); } catch (Throwable e) { throw Debug.handle(e);
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java Fri Jun 19 09:31:51 2015 -0700 @@ -76,6 +76,12 @@ SPARCAddress addr = new SPARCAddress(SPARC.sp, sr2); Kind resultKind = (Kind) result.getPlatformKind(); switch (resultKind) { + case Byte: + masm.stb(sr1, addr); + break; + case Short: + masm.sth(sr1, addr); + break; case Int: masm.stw(sr1, addr); break;
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java Fri Jun 19 09:31:51 2015 -0700 @@ -490,7 +490,6 @@ } // Remove redundant begin nodes. - Debug.dump(graph, "Before removing redundant begins"); for (BeginNode beginNode : graph.getNodes(BeginNode.TYPE)) { Node predecessor = beginNode.predecessor(); if (predecessor instanceof ControlSplitNode) {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhase.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhase.java Fri Jun 19 09:31:51 2015 -0700 @@ -121,7 +121,7 @@ try (DebugCloseable a = timer.start(); DebugCloseable c = memUseTracker.start()) { run(target, lirGenRes, codeEmittingOrder, linearScanOrder, context); if (dumpLIR && Debug.isDumpEnabled(PHASE_DUMP_LEVEL)) { - Debug.dump(PHASE_DUMP_LEVEL, lirGenRes.getLIR(), "After phase %s", getName()); + Debug.dump(PHASE_DUMP_LEVEL, lirGenRes.getLIR(), "%s", getName()); } } } catch (Throwable e) {
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/phases/LoopFullUnrollPhase.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/phases/LoopFullUnrollPhase.java Fri Jun 19 09:31:51 2015 -0700 @@ -51,7 +51,7 @@ Debug.log("FullUnroll %s", loop); LoopTransformations.fullUnroll(loop, context, canonicalizer); FULLY_UNROLLED_LOOPS.increment(); - Debug.dump(graph, "After fullUnroll %s", loop); + Debug.dump(graph, "FullUnroll %s", loop); peeled = true; break; }
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/phases/LoopPeelingPhase.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/phases/LoopPeelingPhase.java Fri Jun 19 09:31:51 2015 -0700 @@ -37,7 +37,7 @@ if (LoopPolicies.shouldPeel(loop, data.getCFG())) { Debug.log("Peeling %s", loop); LoopTransformations.peel(loop); - Debug.dump(graph, "After peeling %s", loop); + Debug.dump(graph, "Peeling %s", loop); } } data.deleteUnusedNodes();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Fri Jun 19 09:31:51 2015 -0700 @@ -122,6 +122,8 @@ */ private Map<ResolvedJavaMethod, Integer> inlinedMethods = new HashMap<>(); + private boolean hasUnsafeAccess = false; + /** * Creates a new Graph containing a single {@link AbstractBeginNode} as the {@link #start() * start} node. @@ -609,4 +611,12 @@ public JavaMethod asJavaMethod() { return method(); } + + public boolean hasUnsafeAccess() { + return hasUnsafeAccess; + } + + public void markUnsafeAccess() { + hasUnsafeAccess = true; + } }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java Fri Jun 19 09:31:51 2015 -0700 @@ -25,19 +25,16 @@ import com.oracle.jvmci.meta.ResolvedJavaType; import com.oracle.jvmci.meta.Kind; import com.oracle.jvmci.meta.DeoptimizationReason; -import com.oracle.jvmci.meta.Constant; import com.oracle.jvmci.meta.DeoptimizationAction; import com.oracle.jvmci.meta.ResolvedJavaMethod; -import com.oracle.jvmci.meta.MetaAccessProvider; + import java.util.*; import com.oracle.jvmci.meta.JavaTypeProfile.ProfiledType; -import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; -import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; @@ -59,17 +56,14 @@ private final double maximumMethodProbability; private final ArrayList<Integer> typesToConcretes; private final ArrayList<ProfiledType> ptypes; - private final ArrayList<Double> concretesProbabilities; private final double notRecordedTypeProbability; private final Inlineable[] inlineableElements; - public MultiTypeGuardInlineInfo(Invoke invoke, ArrayList<ResolvedJavaMethod> concretes, ArrayList<Double> concretesProbabilities, ArrayList<ProfiledType> ptypes, - ArrayList<Integer> typesToConcretes, double notRecordedTypeProbability) { + public MultiTypeGuardInlineInfo(Invoke invoke, ArrayList<ResolvedJavaMethod> concretes, ArrayList<ProfiledType> ptypes, ArrayList<Integer> typesToConcretes, double notRecordedTypeProbability) { super(invoke); assert concretes.size() > 0 : "must have at least one method"; assert ptypes.size() == typesToConcretes.size() : "array lengths must match"; - this.concretesProbabilities = concretesProbabilities; this.concretes = concretes; this.ptypes = ptypes; this.typesToConcretes = typesToConcretes; @@ -143,7 +137,7 @@ @Override public Collection<Node> inline(Providers providers) { if (hasSingleMethod()) { - return inlineSingleMethod(graph(), providers.getMetaAccess(), providers.getStampProvider()); + return inlineSingleMethod(graph(), providers.getStampProvider()); } else { return inlineMultipleMethods(graph(), providers); } @@ -220,7 +214,7 @@ assert invoke.asNode().isAlive(); // replace the invoke with a switch on the type of the actual receiver - boolean methodDispatch = createDispatchOnTypeBeforeInvoke(graph, successors, false, providers.getMetaAccess(), providers.getStampProvider()); + boolean methodDispatch = createDispatchOnTypeBeforeInvoke(graph, successors, false, providers.getStampProvider()); assert invoke.next() == continuation; invoke.setNext(null); @@ -301,67 +295,26 @@ return result; } - private Collection<Node> inlineSingleMethod(StructuredGraph graph, MetaAccessProvider metaAccess, StampProvider stampProvider) { + private Collection<Node> inlineSingleMethod(StructuredGraph graph, StampProvider stampProvider) { assert concretes.size() == 1 && inlineableElements.length == 1 && ptypes.size() > 1 && !shouldFallbackToInvoke() && notRecordedTypeProbability == 0; AbstractBeginNode calleeEntryNode = graph.add(new BeginNode()); AbstractBeginNode unknownTypeSux = createUnknownTypeSuccessor(graph); AbstractBeginNode[] successors = new AbstractBeginNode[]{calleeEntryNode, unknownTypeSux}; - createDispatchOnTypeBeforeInvoke(graph, successors, false, metaAccess, stampProvider); + createDispatchOnTypeBeforeInvoke(graph, successors, false, stampProvider); calleeEntryNode.setNext(invoke.asNode()); return inline(invoke, methodAt(0), inlineableElementAt(0), false); } - private boolean createDispatchOnTypeBeforeInvoke(StructuredGraph graph, AbstractBeginNode[] successors, boolean invokeIsOnlySuccessor, MetaAccessProvider metaAccess, StampProvider stampProvider) { + private boolean createDispatchOnTypeBeforeInvoke(StructuredGraph graph, AbstractBeginNode[] successors, boolean invokeIsOnlySuccessor, StampProvider stampProvider) { assert ptypes.size() >= 1; ValueNode nonNullReceiver = InliningUtil.nonNullReceiver(invoke); LoadHubNode hub = graph.unique(new LoadHubNode(stampProvider, nonNullReceiver)); - if (!invokeIsOnlySuccessor && chooseMethodDispatch()) { - assert successors.length == concretes.size() + 1; - assert concretes.size() > 0; - Debug.log("Method check cascade with %d methods", concretes.size()); - - ConstantNode[] constantMethods = new ConstantNode[concretes.size()]; - double[] probability = new double[concretes.size()]; - for (int i = 0; i < concretes.size(); ++i) { - ResolvedJavaMethod firstMethod = concretes.get(i); - Constant firstMethodConstant = firstMethod.getEncoding(); - - ConstantNode firstMethodConstantNode = ConstantNode.forConstant(stampProvider.createMethodStamp(), firstMethodConstant, metaAccess, graph); - constantMethods[i] = firstMethodConstantNode; - double concretesProbability = concretesProbabilities.get(i); - assert concretesProbability >= 0.0; - probability[i] = concretesProbability; - if (i > 0) { - double prevProbability = probability[i - 1]; - if (prevProbability == 1.0) { - probability[i] = 1.0; - } else { - probability[i] = Math.min(1.0, Math.max(0.0, probability[i] / (1.0 - prevProbability))); - } - } - } - - ResolvedJavaType receiverType = invoke.getReceiverType(); - FixedNode lastSucc = successors[concretes.size()]; - for (int i = concretes.size() - 1; i >= 0; --i) { - LoadMethodNode method = graph.add(new LoadMethodNode(stampProvider.createMethodStamp(), concretes.get(i), receiverType, hub)); - LogicNode methodCheck = CompareNode.createCompareNode(graph, Condition.EQ, method, constantMethods[i], null); - IfNode ifNode = graph.add(new IfNode(methodCheck, successors[i], lastSucc, probability[i])); - method.setNext(ifNode); - lastSucc = method; - } - - FixedWithNextNode pred = (FixedWithNextNode) invoke.asNode().predecessor(); - pred.setNext(lastSucc); - return true; - } else { - Debug.log("Type switch with %d types", concretes.size()); - } + Debug.log("Type switch with %d types", concretes.size()); ResolvedJavaType[] keys = new ResolvedJavaType[ptypes.size()]; double[] keyProbabilities = new double[ptypes.size() + 1]; @@ -388,51 +341,6 @@ return false; } - private boolean chooseMethodDispatch() { - ResolvedJavaType receiverType = invoke.getReceiverType(); - for (ResolvedJavaMethod concrete : concretes) { - if (!concrete.isInVirtualMethodTable(receiverType)) { - return false; - } - } - - if (concretes.size() == 1 && this.notRecordedTypeProbability > 0) { - // Always chose method dispatch if there is a single concrete method and the call - // site is megamorphic. - return true; - } - - if (concretes.size() == ptypes.size()) { - // Always prefer types over methods if the number of types is smaller than the - // number of methods. - return false; - } - - return chooseMethodDispatchCostBased(); - } - - private boolean chooseMethodDispatchCostBased() { - double remainder = 1.0 - this.notRecordedTypeProbability; - double costEstimateMethodDispatch = remainder; - for (int i = 0; i < concretes.size(); ++i) { - if (i != 0) { - costEstimateMethodDispatch += remainder; - } - remainder -= concretesProbabilities.get(i); - } - - double costEstimateTypeDispatch = 0.0; - remainder = 1.0; - for (int i = 0; i < ptypes.size(); ++i) { - if (i != 0) { - costEstimateTypeDispatch += remainder; - } - remainder -= ptypes.get(i).getProbability(); - } - costEstimateTypeDispatch += notRecordedTypeProbability; - return costEstimateMethodDispatch < costEstimateTypeDispatch; - } - private static AbstractBeginNode createInvocationBlock(StructuredGraph graph, Invoke invoke, AbstractMergeNode returnMerge, PhiNode returnValuePhi, AbstractMergeNode exceptionMerge, PhiNode exceptionObjectPhi, boolean useForInlining) { Invoke duplicatedInvoke = duplicateInvokeForInlining(graph, invoke, exceptionMerge, exceptionObjectPhi, useForInlining); @@ -487,13 +395,13 @@ @Override public void tryToDevirtualizeInvoke(Providers providers) { if (hasSingleMethod()) { - devirtualizeWithTypeSwitch(graph(), InvokeKind.Special, concretes.get(0), providers.getMetaAccess(), providers.getStampProvider()); + devirtualizeWithTypeSwitch(graph(), InvokeKind.Special, concretes.get(0), providers.getStampProvider()); } else { - tryToDevirtualizeMultipleMethods(graph(), providers.getMetaAccess(), providers.getStampProvider()); + tryToDevirtualizeMultipleMethods(graph(), providers.getStampProvider()); } } - private void tryToDevirtualizeMultipleMethods(StructuredGraph graph, MetaAccessProvider metaAccess, StampProvider stampProvider) { + private void tryToDevirtualizeMultipleMethods(StructuredGraph graph, StampProvider stampProvider) { MethodCallTargetNode methodCallTarget = (MethodCallTargetNode) invoke.callTarget(); if (methodCallTarget.invokeKind() == InvokeKind.Interface) { ResolvedJavaMethod targetMethod = methodCallTarget.targetMethod(); @@ -505,17 +413,17 @@ if (!leastCommonType.isInterface() && targetMethod.getDeclaringClass().isAssignableFrom(leastCommonType)) { ResolvedJavaMethod baseClassTargetMethod = leastCommonType.resolveConcreteMethod(targetMethod, contextType); if (baseClassTargetMethod != null) { - devirtualizeWithTypeSwitch(graph, InvokeKind.Virtual, leastCommonType.resolveConcreteMethod(targetMethod, contextType), metaAccess, stampProvider); + devirtualizeWithTypeSwitch(graph, InvokeKind.Virtual, leastCommonType.resolveConcreteMethod(targetMethod, contextType), stampProvider); } } } } - private void devirtualizeWithTypeSwitch(StructuredGraph graph, InvokeKind kind, ResolvedJavaMethod target, MetaAccessProvider metaAccess, StampProvider stampProvider) { + private void devirtualizeWithTypeSwitch(StructuredGraph graph, InvokeKind kind, ResolvedJavaMethod target, StampProvider stampProvider) { AbstractBeginNode invocationEntry = graph.add(new BeginNode()); AbstractBeginNode unknownTypeSux = createUnknownTypeSuccessor(graph); AbstractBeginNode[] successors = new AbstractBeginNode[]{invocationEntry, unknownTypeSux}; - createDispatchOnTypeBeforeInvoke(graph, successors, true, metaAccess, stampProvider); + createDispatchOnTypeBeforeInvoke(graph, successors, true, stampProvider); invocationEntry.setNext(invoke.asNode()); ValueNode receiver = ((MethodCallTargetNode) invoke.callTarget()).receiver();
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Fri Jun 19 09:31:51 2015 -0700 @@ -335,7 +335,7 @@ return null; } } - return new MultiTypeGuardInlineInfo(invoke, concreteMethods, concreteMethodsProbabilities, usedTypes, typesToConcretes, notRecordedTypeProbability); + return new MultiTypeGuardInlineInfo(invoke, concreteMethods, usedTypes, typesToConcretes, notRecordedTypeProbability); } }
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/BasePhase.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/BasePhase.java Fri Jun 19 09:31:51 2015 -0700 @@ -135,7 +135,7 @@ apply(graph, context, true); } - public final void apply(final StructuredGraph graph, final C context, final boolean dumpGraph) { + protected final void apply(final StructuredGraph graph, final C context, final boolean dumpGraph) { try (DebugCloseable a = timer.start(); Scope s = Debug.scope(getClass(), this); DebugCloseable c = memUseTracker.start()) { if (dumpGraph && Debug.isDumpEnabled(BEFORE_PHASE_DUMP_LEVEL)) { Debug.dump(BEFORE_PHASE_DUMP_LEVEL, graph, "Before phase %s", getName()); @@ -144,14 +144,14 @@ executionCount.increment(); inputNodesCount.add(graph.getNodeCount()); if (dumpGraph && Debug.isDumpEnabled(PHASE_DUMP_LEVEL)) { - Debug.dump(PHASE_DUMP_LEVEL, graph, "After phase %s", getName()); + Debug.dump(PHASE_DUMP_LEVEL, graph, "%s", getName()); } if (Fingerprint.ENABLED) { String graphDesc = graph.method() == null ? graph.name : graph.method().format("%H.%n(%p)"); Fingerprint.submit("After phase %s nodes in %s are %s", getName(), graphDesc, graph.getNodes().snapshot()); } if (Debug.isVerifyEnabled()) { - Debug.verify(graph, "After phase %s", getName()); + Debug.verify(graph, "%s", getName()); } assert graph.verify(); } catch (Throwable t) {
--- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64GraphBuilderPlugins.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64GraphBuilderPlugins.java Fri Jun 19 09:31:51 2015 -0700 @@ -119,6 +119,7 @@ // Emits a null-check for the otherwise unused receiver unsafe.get(); b.addPush(kind, new AtomicReadAndWriteNode(object, offset, value, kind, LocationIdentity.any())); + b.getGraph().markUnsafeAccess(); return true; } }); @@ -129,6 +130,7 @@ unsafe.get(); AddressNode address = b.add(new OffsetAddressNode(object, offset)); b.addPush(kind, new AtomicReadAndAddNode(address, delta, LocationIdentity.any())); + b.getGraph().markUnsafeAccess(); return true; } });
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java Fri Jun 19 09:31:51 2015 -0700 @@ -88,6 +88,7 @@ } private static final Field STRING_VALUE_FIELD; + static { try { STRING_VALUE_FIELD = String.class.getDeclaredField("value"); @@ -170,6 +171,7 @@ // Emits a null-check for the otherwise unused receiver unsafe.get(); b.addPush(Kind.Int, new CompareAndSwapNode(object, offset, expected, x, kind, LocationIdentity.any())); + b.getGraph().markUnsafeAccess(); return true; } }); @@ -534,6 +536,7 @@ // Emits a null-check for the otherwise unused receiver unsafe.get(); b.addPush(returnKind, new DirectReadNode(address, returnKind)); + b.getGraph().markUnsafeAccess(); return true; } @@ -547,6 +550,7 @@ if (isVolatile) { b.add(new MembarNode(JMM_POST_VOLATILE_READ)); } + b.getGraph().markUnsafeAccess(); return true; } } @@ -565,6 +569,7 @@ // Emits a null-check for the otherwise unused receiver unsafe.get(); b.add(new DirectStoreNode(address, value, kind)); + b.getGraph().markUnsafeAccess(); return true; } @@ -578,6 +583,7 @@ if (isVolatile) { b.add(new MembarNode(JMM_PRE_VOLATILE_WRITE)); } + b.getGraph().markUnsafeAccess(); return true; } }
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/AnsiTerminalDecorator.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import static com.oracle.jvmci.debug.AnsiColor.*; - -import org.junit.runner.*; -import org.junit.runner.notification.*; - -/** - * Color support for JUnit test output using ANSI escapes codes. - */ -public class AnsiTerminalDecorator extends GraalJUnitRunListenerDecorator { - - public AnsiTerminalDecorator(GraalJUnitRunListener l) { - super(l); - } - - @Override - public void testSucceeded(Description description) { - getWriter().print(GREEN); - super.testSucceeded(description); - getWriter().print(RESET); - } - - @Override - public void testAssumptionFailure(Failure failure) { - getWriter().print(BLUE); - super.testAssumptionFailure(failure); - getWriter().print(RESET); - } - - @Override - public void testFailed(Failure failure) { - getWriter().print(RED); - super.testFailed(failure); - getWriter().print(RESET); - } - - @Override - public void testIgnored(Description description) { - getWriter().print(MAGENTA); - super.testIgnored(description); - getWriter().print(RESET); - } -}
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/EagerStackTraceDecorator.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import org.junit.runner.notification.*; - -public class EagerStackTraceDecorator extends GraalJUnitRunListenerDecorator { - - public EagerStackTraceDecorator(GraalJUnitRunListener l) { - super(l); - } - - @Override - public void testFailed(Failure failure) { - super.testFailed(failure); - failure.getException().printStackTrace(getWriter()); - } - -}
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/GCAfterTestDecorator.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import org.junit.runner.*; - -public class GCAfterTestDecorator extends GraalJUnitRunListenerDecorator { - - public GCAfterTestDecorator(GraalJUnitRunListener l) { - super(l); - } - - @Override - public void testFinished(Description description) { - System.gc(); - super.testFinished(description); - } -}
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalJUnitCore.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,246 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import java.io.*; -import java.lang.reflect.Modifier; -import java.nio.file.*; -import java.util.*; - -import junit.runner.*; - -import org.junit.internal.*; -import org.junit.runner.*; -import org.junit.runner.notification.*; -import org.junit.runners.*; -import org.junit.runners.model.*; - -public class GraalJUnitCore { - - /** - * Run the tests contained in the classes named in the <code>args</code>. A single test method - * can be specified by adding #method after the class name. Only a single test can be run in - * this way. If all tests run successfully, exit with a status of 0. Otherwise exit with a - * status of 1. Write feedback while tests are running and write stack traces for all failed - * tests after the tests all complete. - * - * @param args names of classes in which to find tests to run - */ - public static void main(String... args) { - JUnitSystem system = new RealSystem(); - JUnitCore junitCore = new JUnitCore(); - system.out().println("GraalJUnitCore"); - system.out().println("JUnit version " + Version.id()); - List<Class<?>> classes = new ArrayList<>(); - String methodName = null; - List<Failure> missingClasses = new ArrayList<>(); - boolean verbose = false; - boolean enableTiming = false; - boolean failFast = false; - boolean color = false; - boolean eagerStackTrace = false; - boolean gcAfterTest = false; - - String[] expandedArgs = expandArgs(args); - for (int i = 0; i < expandedArgs.length; i++) { - String each = expandedArgs[i]; - if (each.charAt(0) == '-') { - // command line arguments - if (each.contentEquals("-JUnitVerbose")) { - verbose = true; - } else if (each.contentEquals("-JUnitFailFast")) { - failFast = true; - } else if (each.contentEquals("-JUnitEnableTiming")) { - enableTiming = true; - } else if (each.contentEquals("-JUnitColor")) { - color = true; - } else if (each.contentEquals("-JUnitEagerStackTrace")) { - eagerStackTrace = true; - } else if (each.contentEquals("-JUnitGCAfterTest")) { - gcAfterTest = true; - } else { - system.out().println("Unknown command line argument: " + each); - } - - } else { - /* - * Entries of the form class#method are handled specially. Only one can be specified - * on the command line as there's no obvious way to build a runner for multiple - * ones. - */ - if (methodName != null) { - system.out().println("Only a single class and method can be specified: " + each); - System.exit(1); - } else if (each.contains("#")) { - String[] pair = each.split("#"); - if (pair.length != 2) { - system.out().println("Malformed class and method request: " + each); - System.exit(1); - } else if (classes.size() != 0) { - system.out().println("Only a single class and method can be specified: " + each); - System.exit(1); - } else { - methodName = pair[1]; - each = pair[0]; - } - } - try { - Class<?> cls = Class.forName(each, false, GraalJUnitCore.class.getClassLoader()); - if ((cls.getModifiers() & Modifier.ABSTRACT) == 0) { - classes.add(cls); - } - } catch (ClassNotFoundException e) { - system.out().println("Could not find class: " + each); - Description description = Description.createSuiteDescription(each); - Failure failure = new Failure(description, e); - missingClasses.add(failure); - } - } - } - final GraalTextListener textListener; - if (!verbose) { - textListener = new GraalTextListener(system); - } else { - textListener = new GraalVerboseTextListener(system); - } - GraalJUnitRunListener graalListener = textListener; - if (enableTiming) { - graalListener = new TimingDecorator(graalListener); - } - if (color) { - graalListener = new AnsiTerminalDecorator(graalListener); - } - if (eagerStackTrace) { - graalListener = new EagerStackTraceDecorator(graalListener); - } - if (gcAfterTest) { - graalListener = new GCAfterTestDecorator(graalListener); - } - junitCore.addListener(GraalTextListener.createRunListener(graalListener)); - Request request; - if (methodName == null) { - request = Request.classes(classes.toArray(new Class[0])); - if (failFast) { - Runner runner = request.getRunner(); - if (runner instanceof ParentRunner) { - ParentRunner<?> parentRunner = (ParentRunner<?>) runner; - parentRunner.setScheduler(new RunnerScheduler() { - public void schedule(Runnable childStatement) { - if (textListener.getLastFailure() == null) { - childStatement.run(); - } - } - - public void finished() { - } - }); - } else { - system.out().println("Unexpected Runner subclass " + runner.getClass().getName() + " - fail fast not supported"); - } - } - } else { - if (failFast) { - system.out().println("Single method selected - fail fast not supported"); - } - request = Request.method(classes.get(0), methodName); - } - Result result = junitCore.run(request); - for (Failure each : missingClasses) { - result.getFailures().add(each); - } - System.exit(result.wasSuccessful() ? 0 : 1); - } - - /** - * Gets the command line for the current process. - * - * @return the command line arguments for the current process or {@code null} if they are not - * available - */ - public static List<String> getProcessCommandLine() { - String processArgsFile = System.getenv().get("MX_SUBPROCESS_COMMAND_FILE"); - if (processArgsFile != null) { - try { - return Files.readAllLines(new File(processArgsFile).toPath()); - } catch (IOException e) { - } - } - return null; - } - - /** - * Expand any arguments starting with @ and return the resulting argument array. - * - * @param args - * @return the expanded argument array - */ - private static String[] expandArgs(String[] args) { - List<String> result = null; - for (int i = 0; i < args.length; i++) { - String arg = args[i]; - if (arg.length() > 0 && arg.charAt(0) == '@') { - if (result == null) { - result = new ArrayList<>(); - for (int j = 0; j < i; j++) { - result.add(args[j]); - } - expandArg(arg.substring(1), result); - } - } else if (result != null) { - result.add(arg); - } - } - return result != null ? result.toArray(new String[0]) : args; - } - - /** - * Add each line from {@code filename} to the list {@code args}. - * - * @param filename - * @param args - */ - private static void expandArg(String filename, List<String> args) { - BufferedReader br = null; - try { - br = new BufferedReader(new FileReader(filename)); - - String buf; - while ((buf = br.readLine()) != null) { - args.add(buf); - } - br.close(); - } catch (IOException ioe) { - ioe.printStackTrace(); - System.exit(2); - } finally { - try { - if (br != null) { - br.close(); - } - } catch (IOException ioe) { - ioe.printStackTrace(); - System.exit(3); - } - } - } -}
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalJUnitRunListener.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import java.io.*; - -import org.junit.internal.*; -import org.junit.runner.*; -import org.junit.runner.notification.*; - -public interface GraalJUnitRunListener { - - /** - * Called before any tests have been run. - * - * @param description describes the tests to be run - */ - void testRunStarted(Description description); - - /** - * Called when all tests have finished. - * - * @param result the summary of the test run, including all the tests that failed - */ - void testRunFinished(Result result); - - /** - * Called when a test class is about to be started. - * - * @param clazz the test class - */ - void testClassStarted(Class<?> clazz); - - /** - * Called when all tests of a test class have finished. - * - * @param clazz the test class - */ - void testClassFinished(Class<?> clazz); - - /** - * Called when an atomic test is about to be started. This is also called for ignored tests. - * - * @param description the description of the test that is about to be run (generally a class and - * method name) - */ - void testStarted(Description description); - - /** - * Called when an atomic test has finished, whether the test succeeds, fails or is ignored. - * - * @param description the description of the test that just ran - */ - void testFinished(Description description); - - /** - * Called when an atomic test fails. - * - * @param failure describes the test that failed and the exception that was thrown - */ - void testFailed(Failure failure); - - /** - * Called when a test will not be run, generally because a test method is annotated with - * {@link org.junit.Ignore}. - * - * @param description describes the test that will not be run - */ - void testIgnored(Description description); - - /** - * Called when an atomic test succeeds. - * - * @param description describes the test that will not be run - */ - void testSucceeded(Description description); - - /** - * Called when an atomic test flags that it assumes a condition that is false. - * - * @param failure describes the test that failed and the {@link AssumptionViolatedException} - * that was thrown - */ - void testAssumptionFailure(Failure failure); - - /** - * Called after {@link #testClassFinished(Class)}. - */ - void testClassFinishedDelimiter(); - - /** - * Called after {@link #testClassStarted(Class)}. - */ - void testClassStartedDelimiter(); - - /** - * Called after {@link #testStarted(Description)}. - */ - void testStartedDelimiter(); - - /** - * Called after {@link #testFailed(Failure)}. - */ - void testFinishedDelimiter(); - - PrintStream getWriter(); - -}
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalJUnitRunListenerDecorator.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import java.io.*; - -import org.junit.runner.*; -import org.junit.runner.notification.*; - -public class GraalJUnitRunListenerDecorator implements GraalJUnitRunListener { - - private final GraalJUnitRunListener l; - - public GraalJUnitRunListenerDecorator(GraalJUnitRunListener l) { - this.l = l; - } - - @Override - public void testRunStarted(Description description) { - l.testRunStarted(description); - } - - @Override - public void testRunFinished(Result result) { - l.testRunFinished(result); - } - - @Override - public void testAssumptionFailure(Failure failure) { - l.testAssumptionFailure(failure); - } - - @Override - public void testIgnored(Description description) { - l.testIgnored(description); - } - - @Override - public void testClassStarted(Class<?> clazz) { - l.testClassStarted(clazz); - } - - @Override - public void testClassFinished(Class<?> clazz) { - l.testClassFinished(clazz); - } - - @Override - public void testStarted(Description description) { - l.testStarted(description); - } - - @Override - public void testFinished(Description description) { - l.testFinished(description); - } - - @Override - public void testFailed(Failure failure) { - l.testFailed(failure); - } - - @Override - public void testSucceeded(Description description) { - l.testSucceeded(description); - } - - @Override - public PrintStream getWriter() { - return l.getWriter(); - } - - public void testClassFinishedDelimiter() { - l.testClassFinishedDelimiter(); - } - - public void testClassStartedDelimiter() { - l.testClassStartedDelimiter(); - } - - public void testStartedDelimiter() { - l.testStartedDelimiter(); - } - - public void testFinishedDelimiter() { - l.testFinishedDelimiter(); - } - -}
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalTextListener.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import java.io.*; - -import org.junit.internal.*; -import org.junit.runner.*; -import org.junit.runner.notification.*; - -public class GraalTextListener implements GraalJUnitRunListener { - - private final PrintStream fWriter; - protected Failure lastFailure; - - public GraalTextListener(JUnitSystem system) { - this(system.out()); - } - - public GraalTextListener(PrintStream writer) { - fWriter = writer; - } - - @Override - public PrintStream getWriter() { - return fWriter; - } - - public Failure getLastFailure() { - return lastFailure; - } - - @Override - public void testRunStarted(Description description) { - } - - @Override - public void testRunFinished(Result result) { - } - - @Override - public void testAssumptionFailure(Failure failure) { - } - - @Override - public void testClassStarted(Class<?> clazz) { - } - - @Override - public void testClassFinished(Class<?> clazz) { - } - - @Override - public void testStarted(Description description) { - getWriter().print('.'); - } - - @Override - public void testFinished(Description description) { - } - - @Override - public void testFailed(Failure failure) { - getWriter().print('E'); - lastFailure = failure; - } - - @Override - public void testSucceeded(Description description) { - } - - @Override - public void testIgnored(Description description) { - getWriter().print('I'); - } - - @Override - public void testClassFinishedDelimiter() { - } - - @Override - public void testClassStartedDelimiter() { - } - - @Override - public void testStartedDelimiter() { - } - - @Override - public void testFinishedDelimiter() { - } - - public static RunListener createRunListener(GraalJUnitRunListener l) { - return new TextListener(l.getWriter()) { - private Class<?> lastClass; - private boolean failed; - - @Override - public final void testStarted(Description description) { - Class<?> currentClass = description.getTestClass(); - if (currentClass != lastClass) { - if (lastClass != null) { - l.testClassFinished(lastClass); - l.testClassFinishedDelimiter(); - } - lastClass = currentClass; - l.testClassStarted(currentClass); - l.testClassStartedDelimiter(); - } - failed = false; - l.testStarted(description); - l.testStartedDelimiter(); - } - - @Override - public final void testFailure(Failure failure) { - failed = true; - l.testFailed(failure); - } - - @Override - public final void testFinished(Description description) { - // we have to do this because there is no callback for successful tests - if (!failed) { - l.testSucceeded(description); - } - l.testFinished(description); - l.testFinishedDelimiter(); - } - - @Override - public void testIgnored(Description description) { - l.testStarted(description); - l.testStartedDelimiter(); - l.testIgnored(description); - l.testFinished(description); - l.testFinishedDelimiter(); - } - - @Override - public void testRunStarted(Description description) { - l.testRunStarted(description); - } - - @Override - public void testRunFinished(Result result) { - if (lastClass != null) { - l.testClassFinished(lastClass); - } - l.testRunFinished(result); - super.testRunFinished(result); - } - - @Override - public void testAssumptionFailure(Failure failure) { - l.testAssumptionFailure(failure); - } - - }; - } - -}
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalVerboseTextListener.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import java.io.*; - -import org.junit.internal.*; -import org.junit.runner.*; -import org.junit.runner.notification.*; - -public class GraalVerboseTextListener extends GraalTextListener { - - public GraalVerboseTextListener(JUnitSystem system) { - this(system.out()); - } - - public GraalVerboseTextListener(PrintStream writer) { - super(writer); - } - - @Override - public void testClassStarted(Class<?> clazz) { - getWriter().print(clazz.getName() + " started"); - } - - @Override - public void testClassFinished(Class<?> clazz) { - getWriter().print(clazz.getName() + " finished"); - } - - @Override - public void testStarted(Description description) { - getWriter().print(" " + description.getMethodName() + ": "); - } - - @Override - public void testIgnored(Description description) { - getWriter().print("Ignored"); - } - - @Override - public void testSucceeded(Description description) { - getWriter().print("Passed"); - } - - @Override - public void testAssumptionFailure(Failure failure) { - getWriter().printf("(%s) ", failure.getMessage()); - } - - @Override - public void testFailed(Failure failure) { - getWriter().print("FAILED"); - lastFailure = failure; - } - - @Override - public void testClassFinishedDelimiter() { - getWriter().println(); - } - - @Override - public void testClassStartedDelimiter() { - getWriter().println(); - } - - @Override - public void testFinishedDelimiter() { - getWriter().println(); - } - -}
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/TimingDecorator.java Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.test; - -import org.junit.runner.*; - -/** - * Timing support for JUnit test runs. - */ -public class TimingDecorator extends GraalJUnitRunListenerDecorator { - - private long startTime; - private long classStartTime; - - public TimingDecorator(GraalJUnitRunListener l) { - super(l); - } - - @Override - public void testClassStarted(Class<?> clazz) { - classStartTime = System.nanoTime(); - super.testClassStarted(clazz); - } - - @Override - public void testClassFinished(Class<?> clazz) { - long totalTime = System.nanoTime() - classStartTime; - super.testClassFinished(clazz); - getWriter().print(' ' + valueToString(totalTime)); - } - - @Override - public void testStarted(Description description) { - startTime = System.nanoTime(); - super.testStarted(description); - } - - @Override - public void testFinished(Description description) { - long totalTime = System.nanoTime() - startTime; - super.testFinished(description); - getWriter().print(" " + valueToString(totalTime)); - } - - private static String valueToString(long value) { - return String.format("%d.%d ms", value / 1000000, (value / 100000) % 10); - } - -}
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectsPhase.java Fri Jun 19 09:28:25 2015 -0700 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/EffectsPhase.java Fri Jun 19 09:31:51 2015 -0700 @@ -98,7 +98,7 @@ } if (Debug.isDumpEnabled()) { - Debug.dump(graph, "after " + getName() + " iteration"); + Debug.dump(graph, getName() + " iteration"); } new DeadCodeEliminationPhase(Required).apply(graph);
--- a/jvmci/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CompilationResult.java Fri Jun 19 09:28:25 2015 -0700 +++ b/jvmci/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CompilationResult.java Fri Jun 19 09:31:51 2015 -0700 @@ -516,6 +516,8 @@ private int bytecodeSize; + private boolean hasUnsafeAccess; + public CompilationResult() { this(null); } @@ -937,7 +939,16 @@ return name; } + public void setHasUnsafeAccess(boolean hasUnsafeAccess) { + this.hasUnsafeAccess = hasUnsafeAccess; + } + + public boolean hasUnsafeAccess() { + return hasUnsafeAccess; + } + public void reset() { + hasUnsafeAccess = false; infopoints.clear(); dataPatches.clear(); exceptionHandlers.clear();
--- a/jvmci/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompilationTask.java Fri Jun 19 09:28:25 2015 -0700 +++ b/jvmci/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompilationTask.java Fri Jun 19 09:31:51 2015 -0700 @@ -66,11 +66,13 @@ */ private final boolean installAsDefault; - /** - * A {@link com.sun.management.ThreadMXBean} to be able to query some information about the - * current compiler thread, e.g. total allocated bytes. - */ - private static final com.sun.management.ThreadMXBean threadMXBean = (com.sun.management.ThreadMXBean) Management.getThreadMXBean(); + static class Lazy { + /** + * A {@link com.sun.management.ThreadMXBean} to be able to query some information about the + * current compiler thread, e.g. total allocated bytes. + */ + static final com.sun.management.ThreadMXBean threadMXBean = (com.sun.management.ThreadMXBean) Management.getThreadMXBean(); + } /** * The address of the JVMCIEnv associated with this compilation or 0L if no such object exists. @@ -135,13 +137,21 @@ try (DebugCloseable a = CompilationTime.start()) { CompilationStatistics stats = CompilationStatistics.create(method, isOSR); final boolean printCompilation = PrintCompilation.getValue() && !TTY.isSuppressed(); + final boolean printAfterCompilation = PrintAfterCompilation.getValue() && !TTY.isSuppressed(); if (printCompilation) { TTY.println(getMethodDescription() + "..."); } TTY.Filter filter = new TTY.Filter(PrintFilter.getValue(), method); - final long start = System.currentTimeMillis(); - final long allocatedBytesBefore = threadMXBean.getThreadAllocatedBytes(threadId); + final long start; + final long allocatedBytesBefore; + if (printAfterCompilation || printCompilation) { + start = System.currentTimeMillis(); + allocatedBytesBefore = printAfterCompilation || printCompilation ? Lazy.threadMXBean.getThreadAllocatedBytes(threadId) : 0L; + } else { + start = 0L; + allocatedBytesBefore = 0L; + } try (Scope s = Debug.scope("Compiling", new DebugDumpScope(String.valueOf(id), true))) { // Begin the compilation event. @@ -157,12 +167,11 @@ compilationEvent.end(); filter.remove(); - final boolean printAfterCompilation = PrintAfterCompilation.getValue() && !TTY.isSuppressed(); if (printAfterCompilation || printCompilation) { final long stop = System.currentTimeMillis(); final int targetCodeSize = result != null ? result.getTargetCodeSize() : -1; - final long allocatedBytesAfter = threadMXBean.getThreadAllocatedBytes(threadId); + final long allocatedBytesAfter = Lazy.threadMXBean.getThreadAllocatedBytes(threadId); final long allocatedBytes = (allocatedBytesAfter - allocatedBytesBefore) / 1024; if (printAfterCompilation) {
--- a/jvmci/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompiledNmethod.java Fri Jun 19 09:28:25 2015 -0700 +++ b/jvmci/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompiledNmethod.java Fri Jun 19 09:31:51 2015 -0700 @@ -35,6 +35,7 @@ public final int entryBCI; public final int id; public final long jvmciEnv; + public final boolean hasUnsafeAccess; /** * May be set by VM if code installation fails. It will describe in more detail why installation @@ -52,6 +53,7 @@ this.entryBCI = compResult.getEntryBCI(); this.id = compResult.getId(); this.jvmciEnv = jvmciEnv; + this.hasUnsafeAccess = compResult.hasUnsafeAccess(); } @Override
--- a/jvmci/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstantPool.java Fri Jun 19 09:28:25 2015 -0700 +++ b/jvmci/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstantPool.java Fri Jun 19 09:31:51 2015 -0700 @@ -620,7 +620,9 @@ int methodRefCacheIndex = -1; switch (tag) { case MethodRef: - methodRefCacheIndex = toConstantPoolIndex(cpi, opcode); + if (Bytecodes.isInvoke(opcode)) { + methodRefCacheIndex = toConstantPoolIndex(cpi, opcode); + } // fall through case Fieldref: case InterfaceMethodref:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mx.graal/.project Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>mx.graal</name> + <comment></comment> + <projects> + <project>mxtool</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.python.pydev.PyDevBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.python.pydev.pythonNature</nature> + </natures> +</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mx.graal/.pydevproject Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?eclipse-pydev version="1.0"?> + +<pydev_project> +<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> +<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property> +<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> +<path>/mx.graal</path> +</pydev_pathproperty> +<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> +<path>/mxtool</path> +</pydev_pathproperty> + +</pydev_project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mx.graal/mx_graal.py Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,2416 @@ +# +# commands.py - the GraalVM specific commands +# +# ---------------------------------------------------------------------------------------------------- +# +# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# ---------------------------------------------------------------------------------------------------- + +import os, stat, errno, sys, shutil, zipfile, tarfile, tempfile, re, time, datetime, platform, subprocess, StringIO, socket +from os.path import join, exists, dirname, basename +from argparse import ArgumentParser, REMAINDER +from outputparser import OutputParser, ValuesMatcher +import mx +import mx_unittest +import xml.dom.minidom +import sanitycheck +import itertools +import json, textwrap +import mx_graal_makefile + +_suite = mx.suite('graal') +_graal_home = _suite.dir + +""" The VMs that can be built and run along with an optional description. Only VMs with a + description are listed in the dialogue for setting the default VM (see _get_vm()). """ +_vmChoices = { + 'jvmci' : 'Normal compilation is performed with a tiered system (C1 + Graal), Truffle compilation is performed with Graal.', + 'server' : 'Normal compilation is performed with a tiered system (C1 + C2), Truffle compilation is performed with Graal. Use this for optimal Truffle performance.', + 'client' : None, # normal compilation with client compiler, explicit compilation (e.g., by Truffle) with Graal + 'server-nojvmci' : None, # all compilation with tiered system (i.e., client + server), JVMCI omitted + 'client-nojvmci' : None, # all compilation with client compiler, JVMCI omitted + 'original' : None, # default VM copied from bootstrap JDK + 'graal' : None, # alias for jvmci + 'server-nograal' : None, # alias for server-nojvmci + 'client-nograal' : None, # alias for client-nojvmci +} + +""" The VM that will be run by the 'vm' command and built by default by the 'build' command. + This can be set via the global '--vm' option or the DEFAULT_VM environment variable. + It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ +_vm = None + +""" The VM builds that will be run by the 'vm' command - default is first in list """ +_vmbuildChoices = ['product', 'fastdebug', 'debug', 'optimized'] + +""" The VM build that will be run by the 'vm' command. + This can be set via the global '--vmbuild' option. + It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ +_vmbuild = _vmbuildChoices[0] + +_jacoco = 'off' + +""" The current working directory to switch to before running the VM. """ +_vm_cwd = None + +""" The base directory in which the JDKs cloned from $JAVA_HOME exist. """ +_installed_jdks = None + +""" Prefix for running the VM. """ +_vm_prefix = None + +_make_eclipse_launch = False + +_minVersion = mx.VersionSpec('1.8') + +# max version (first _unsupported_ version) +_untilVersion = None + +class JDKDeployedDist: + def __init__(self, name, isExtension=False, usesJVMCIClassLoader=False, partOfHotSpot=False): + self.name = name + self.isExtension = isExtension + self.usesJVMCIClassLoader = usesJVMCIClassLoader + self.partOfHotSpot = partOfHotSpot # true when this distribution is delivered with HotSpot + +_jdkDeployedDists = [ + JDKDeployedDist('TRUFFLE'), + JDKDeployedDist('JVMCI_SERVICE', partOfHotSpot=True), + JDKDeployedDist('JVMCI_API', usesJVMCIClassLoader=True, partOfHotSpot=True), + JDKDeployedDist('JVMCI_HOTSPOT', usesJVMCIClassLoader=True, partOfHotSpot=True), + JDKDeployedDist('GRAAL', usesJVMCIClassLoader=True), + JDKDeployedDist('GRAAL_TRUFFLE', usesJVMCIClassLoader=True) +] + +JDK_UNIX_PERMISSIONS_DIR = 0755 +JDK_UNIX_PERMISSIONS_FILE = 0644 +JDK_UNIX_PERMISSIONS_EXEC = 0755 + +def isVMSupported(vm): + if 'client' == vm and len(platform.mac_ver()[0]) != 0: + # Client VM not supported: java launcher on Mac OS X translates '-client' to '-server' + return False + return True + +def _get_vm(): + """ + Gets the configured VM, presenting a dialogue if there is no currently configured VM. + """ + global _vm + if _vm: + return _vm + vm = mx.get_env('DEFAULT_VM') + envPath = join(_suite.mxDir, 'env') + if vm and 'graal' in vm: + if exists(envPath): + with open(envPath) as fp: + if 'DEFAULT_VM=' + vm in fp.read(): + mx.log('Please update the DEFAULT_VM value in ' + envPath + ' to replace "graal" with "jvmci"') + vm = vm.replace('graal', 'jvmci') + if vm is None: + if not mx.is_interactive(): + mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') + mx.log('Please select the VM to be executed from the following: ') + items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] + descriptions = [_vmChoices[k] for k in _vmChoices.keys() if _vmChoices[k] is not None] + vm = mx.select_items(items, descriptions, allowMultiple=False) + mx.ask_persist_env('DEFAULT_VM', vm) + _vm = vm + return vm + +""" +A context manager that can be used with the 'with' statement to set the VM +used by all VM executions within the scope of the 'with' statement. For example: + + with VM('server'): + dacapo(['pmd']) +""" +class VM: + def __init__(self, vm=None, build=None): + assert vm is None or vm in _vmChoices.keys() + assert build is None or build in _vmbuildChoices + self.vm = vm if vm else _vm + self.build = build if build else _vmbuild + self.previousVm = _vm + self.previousBuild = _vmbuild + + def __enter__(self): + global _vm, _vmbuild + _vm = self.vm + _vmbuild = self.build + + def __exit__(self, exc_type, exc_value, traceback): + global _vm, _vmbuild + _vm = self.previousVm + _vmbuild = self.previousBuild + +def chmodRecursive(dirname, chmodFlagsDir): + if mx.get_os() == 'windows': + return + + def _chmodDir(chmodFlags, dirname, fnames): + os.chmod(dirname, chmodFlagsDir) + + os.path.walk(dirname, _chmodDir, chmodFlagsDir) + +def clean(args): + """clean the source tree""" + opts = mx.clean(args, parser=ArgumentParser(prog='mx clean')) + + if opts.native: + def handleRemoveReadonly(func, path, exc): + excvalue = exc[1] + if mx.get_os() == 'windows' and func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES: + os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) # 0777 + func(path) + else: + raise + + def rmIfExists(name): + if os.path.isdir(name): + shutil.rmtree(name, ignore_errors=False, onerror=handleRemoveReadonly) + elif os.path.isfile(name): + os.unlink(name) + + rmIfExists(join(_graal_home, 'build')) + rmIfExists(join(_graal_home, 'build-nojvmci')) + rmIfExists(_jdksDir()) + +def export(args): + """create archives of builds split by vmbuild and vm""" + + parser = ArgumentParser(prog='mx export') + args = parser.parse_args(args) + + # collect data about export + infos = dict() + infos['timestamp'] = time.time() + + hgcfg = mx.HgConfig() + hgcfg.check() + infos['revision'] = hgcfg.tip('.') + ('+' if hgcfg.isDirty('.') else '') + # TODO: infos['repository'] + + infos['jdkversion'] = str(mx.java().version) + + infos['architecture'] = mx.get_arch() + infos['platform'] = mx.get_os() + + if mx.get_os != 'windows': + pass + # infos['ccompiler'] + # infos['linker'] + + infos['hostname'] = socket.gethostname() + + def _writeJson(suffix, properties): + d = infos.copy() + for k, v in properties.iteritems(): + assert not d.has_key(k) + d[k] = v + + jsonFileName = 'export-' + suffix + '.json' + with open(jsonFileName, 'w') as f: + print >> f, json.dumps(d) + return jsonFileName + + + def _genFileName(archivtype, middle): + idPrefix = infos['revision'] + '_' + idSuffix = '.tar.gz' + return join(_graal_home, "graalvm_" + archivtype + "_" + idPrefix + middle + idSuffix) + + def _genFileArchPlatformName(archivtype, middle): + return _genFileName(archivtype, infos['platform'] + '_' + infos['architecture'] + '_' + middle) + + + # archive different build types of hotspot + for vmBuild in _vmbuildChoices: + jdkpath = join(_jdksDir(), vmBuild) + if not exists(jdkpath): + mx.logv("skipping " + vmBuild) + continue + + tarName = _genFileArchPlatformName('basejdk', vmBuild) + mx.logv("creating basejdk " + tarName) + vmSet = set() + with tarfile.open(tarName, 'w:gz') as tar: + for root, _, files in os.walk(jdkpath): + if basename(root) in _vmChoices.keys(): + # TODO: add some assert to check path assumption + vmSet.add(root) + continue + + for f in files: + name = join(root, f) + # print name + tar.add(name, name) + + n = _writeJson("basejdk-" + vmBuild, {'vmbuild' : vmBuild}) + tar.add(n, n) + + # create a separate archive for each VM + for vm in vmSet: + bVm = basename(vm) + vmTarName = _genFileArchPlatformName('vm', vmBuild + '_' + bVm) + mx.logv("creating vm " + vmTarName) + + debugFiles = set() + with tarfile.open(vmTarName, 'w:gz') as tar: + for root, _, files in os.walk(vm): + for f in files: + # TODO: mac, windows, solaris? + if any(map(f.endswith, [".debuginfo"])): + debugFiles.add(f) + else: + name = join(root, f) + # print name + tar.add(name, name) + + n = _writeJson("vm-" + vmBuild + "-" + bVm, {'vmbuild' : vmBuild, 'vm' : bVm}) + tar.add(n, n) + + if len(debugFiles) > 0: + debugTarName = _genFileArchPlatformName('debugfilesvm', vmBuild + '_' + bVm) + mx.logv("creating debugfilesvm " + debugTarName) + with tarfile.open(debugTarName, 'w:gz') as tar: + for f in debugFiles: + name = join(root, f) + # print name + tar.add(name, name) + + n = _writeJson("debugfilesvm-" + vmBuild + "-" + bVm, {'vmbuild' : vmBuild, 'vm' : bVm}) + tar.add(n, n) + + # graal directory + graalDirTarName = _genFileName('classfiles', 'javac') + mx.logv("creating graal " + graalDirTarName) + with tarfile.open(graalDirTarName, 'w:gz') as tar: + for root, _, files in os.walk("graal"): + for f in [f for f in files if not f.endswith('.java')]: + name = join(root, f) + # print name + tar.add(name, name) + + n = _writeJson("graal", {'javacompiler' : 'javac'}) + tar.add(n, n) + + +def _run_benchmark(args, availableBenchmarks, runBenchmark): + + vmOpts, benchmarksAndOptions = mx.extract_VM_args(args, useDoubleDash=availableBenchmarks is None) + + if availableBenchmarks is None: + harnessArgs = benchmarksAndOptions + return runBenchmark(None, harnessArgs, vmOpts) + + if len(benchmarksAndOptions) == 0: + mx.abort('at least one benchmark name or "all" must be specified') + benchmarks = list(itertools.takewhile(lambda x: not x.startswith('-'), benchmarksAndOptions)) + harnessArgs = benchmarksAndOptions[len(benchmarks):] + + if 'all' in benchmarks: + benchmarks = availableBenchmarks + else: + for bm in benchmarks: + if bm not in availableBenchmarks: + mx.abort('unknown benchmark: ' + bm + '\nselect one of: ' + str(availableBenchmarks)) + + failed = [] + for bm in benchmarks: + if not runBenchmark(bm, harnessArgs, vmOpts): + failed.append(bm) + + if len(failed) != 0: + mx.abort('Benchmark failures: ' + str(failed)) + +def dacapo(args): + """run one or more DaCapo benchmarks""" + + def launcher(bm, harnessArgs, extraVmOpts): + return sanitycheck.getDacapo(bm, harnessArgs).test(_get_vm(), extraVmOpts=extraVmOpts) + + _run_benchmark(args, sanitycheck.dacapoSanityWarmup.keys(), launcher) + +def scaladacapo(args): + """run one or more Scala DaCapo benchmarks""" + + def launcher(bm, harnessArgs, extraVmOpts): + return sanitycheck.getScalaDacapo(bm, harnessArgs).test(_get_vm(), extraVmOpts=extraVmOpts) + + _run_benchmark(args, sanitycheck.dacapoScalaSanityWarmup.keys(), launcher) + +def _vmLibDirInJdk(jdk): + """ + Get the directory within a JDK where the server and client + subdirectories are located. + """ + mxos = mx.get_os() + if mxos == 'darwin': + return join(jdk, 'jre', 'lib') + if mxos == 'windows' or mxos == 'cygwin': + return join(jdk, 'jre', 'bin') + return join(jdk, 'jre', 'lib', mx.get_arch()) + +def _vmJliLibDirs(jdk): + """ + Get the directories within a JDK where the jli library designates to. + """ + mxos = mx.get_os() + if mxos == 'darwin': + return [join(jdk, 'jre', 'lib', 'jli')] + if mxos == 'windows' or mxos == 'cygwin': + return [join(jdk, 'jre', 'bin'), join(jdk, 'bin')] + return [join(jdk, 'jre', 'lib', mx.get_arch(), 'jli'), join(jdk, 'lib', mx.get_arch(), 'jli')] + +def _vmCfgInJdk(jdk, jvmCfgFile='jvm.cfg'): + """ + Get the jvm.cfg file. + """ + mxos = mx.get_os() + if mxos == "windows" or mxos == "cygwin": + return join(jdk, 'jre', 'lib', mx.get_arch(), jvmCfgFile) + return join(_vmLibDirInJdk(jdk), jvmCfgFile) + +def _jdksDir(): + return os.path.abspath(join(_installed_jdks if _installed_jdks else _graal_home, 'jdk' + str(mx.java().version))) + +def _handle_missing_VM(bld, vm=None): + if not vm: + vm = _get_vm() + mx.log('The ' + bld + ' ' + vm + ' VM has not been created') + if mx.is_interactive(): + if mx.ask_yes_no('Build it now', 'y'): + with VM(vm, bld): + build([]) + return + mx.abort('You need to run "mx --vm ' + vm + ' --vmbuild ' + bld + ' build" to build the selected VM') + +def _jdk(build=None, vmToCheck=None, create=False, installJars=True): + """ + Get the JDK into which Graal is installed, creating it first if necessary. + """ + if not build: + build = _vmbuild + jdk = join(_jdksDir(), build) + if create: + srcJdk = mx.java().jdk + if not exists(jdk): + mx.log('Creating ' + jdk + ' from ' + srcJdk) + shutil.copytree(srcJdk, jdk) + + # Make a copy of the default VM so that this JDK can be + # reliably used as the bootstrap for a HotSpot build. + jvmCfg = _vmCfgInJdk(jdk) + if not exists(jvmCfg): + mx.abort(jvmCfg + ' does not exist') + + defaultVM = None + jvmCfgLines = [] + with open(jvmCfg) as f: + for line in f: + if line.startswith('-') and defaultVM is None: + parts = line.split() + if len(parts) == 2: + assert parts[1] == 'KNOWN', parts[1] + defaultVM = parts[0][1:] + jvmCfgLines += ['# default VM is a copy of the unmodified ' + defaultVM + ' VM\n'] + jvmCfgLines += ['-original KNOWN\n'] + else: + # skip lines which we cannot parse (e.g. '-hotspot ALIASED_TO -client') + mx.log("WARNING: skipping not parsable line \"" + line + "\"") + else: + jvmCfgLines += [line] + + assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg + chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) + shutil.move(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), 'original')) + + if mx.get_os() != 'windows': + os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) + with open(jvmCfg, 'w') as fp: + for line in jvmCfgLines: + fp.write(line) + + # patch 'release' file (append graalvm revision) + releaseFile = join(jdk, 'release') + if exists(releaseFile): + releaseFileLines = [] + with open(releaseFile) as f: + for line in f: + releaseFileLines.append(line) + + if mx.get_os() != 'windows': + os.chmod(releaseFile, JDK_UNIX_PERMISSIONS_FILE) + with open(releaseFile, 'w') as fp: + for line in releaseFileLines: + if line.startswith("SOURCE="): + try: + sourceLine = line[0:-2] # remove last char + hgcfg = mx.HgConfig() + hgcfg.check() + revision = hgcfg.tip('.')[:12] # take first 12 chars + fp.write(sourceLine + ' graal:' + revision + '\"\n') + except: + fp.write(line) + else: + fp.write(line) + + # Install a copy of the disassembler library + try: + hsdis([], copyToDir=_vmLibDirInJdk(jdk)) + except SystemExit: + pass + else: + if not exists(jdk): + if _installed_jdks: + mx.log("The selected JDK directory does not (yet) exist: " + jdk) + _handle_missing_VM(build, vmToCheck) + + if installJars: + for jdkDist in _jdkDeployedDists: + dist = mx.distribution(jdkDist.name) + if exists(dist.path) and jdkDist.partOfHotSpot: + _installDistInJdks(jdkDist) + + if vmToCheck is not None: + jvmCfg = _vmCfgInJdk(jdk) + found = False + with open(jvmCfg) as f: + for line in f: + if line.strip() == '-' + vmToCheck + ' KNOWN': + found = True + break + if not found: + _handle_missing_VM(build, vmToCheck) + + return jdk + +def _updateInstalledJVMCIOptionsFile(jdk): + jvmciOptions = join(_graal_home, 'jvmci.options') + jreLibDir = join(jdk, 'jre', 'lib') + if exists(jvmciOptions): + shutil.copy(jvmciOptions, join(jreLibDir, 'jvmci.options')) + else: + toDelete = join(jreLibDir, 'jvmci.options') + if exists(toDelete): + os.unlink(toDelete) + +def _makeHotspotGeneratedSourcesDir(): + """ + Gets the directory containing all the HotSpot sources generated from + JVMCI Java sources. This directory will be created if it doesn't yet exist. + """ + hsSrcGenDir = join(mx.project('com.oracle.jvmci.hotspot').source_gen_dir(), 'hotspot') + if not exists(hsSrcGenDir): + os.makedirs(hsSrcGenDir) + return hsSrcGenDir + +def _copyToJdk(src, dst, permissions=JDK_UNIX_PERMISSIONS_FILE): + name = os.path.basename(src) + dstLib = join(dst, name) + if mx.get_env('SYMLINK_GRAAL_JAR', None) == 'true': + # Using symlinks is much faster than copying but may + # cause issues if the lib is being updated while + # the VM is running. + if not os.path.islink(dstLib) or not os.path.realpath(dstLib) == src: + if exists(dstLib): + os.remove(dstLib) + os.symlink(src, dstLib) + else: + # do a copy and then a move to get atomic updating (on Unix) + fd, tmp = tempfile.mkstemp(suffix='', prefix=name, dir=dst) + shutil.copyfile(src, tmp) + os.close(fd) + shutil.move(tmp, dstLib) + os.chmod(dstLib, permissions) + +def _extractJVMCIFiles(jdkJars, jvmciJars, servicesDir, optionsDir): + if exists(servicesDir): + shutil.rmtree(servicesDir) + if exists(optionsDir): + shutil.rmtree(optionsDir) + if not exists(servicesDir): + os.makedirs(servicesDir) + if not exists(optionsDir): + os.makedirs(optionsDir) + jvmciServices = {} + optionsFiles = [] + for jar in jvmciJars: + if os.path.isfile(jar): + with zipfile.ZipFile(jar) as zf: + for member in zf.namelist(): + if member.startswith('META-INF/jvmci.services') and member: + service = basename(member) + if service == "": + continue # Zip files may contain empty entries for directories (jar -cf ... creates such) + # we don't handle directories + assert service and member == 'META-INF/jvmci.services/' + service + with zf.open(member) as serviceFile: + providers = jvmciServices.setdefault(service, []) + for line in serviceFile.readlines(): + line = line.strip() + if line: + providers.append(line) + elif member.startswith('META-INF/jvmci.options'): + filename = basename(member) + if filename == "": + continue # Zip files may contain empty entries for directories (jar -cf ... creates such) + # we don't handle directories + assert filename and member == 'META-INF/jvmci.options/' + filename + targetpath = join(optionsDir, filename) + optionsFiles.append(filename) + with zf.open(member) as optionsFile, \ + file(targetpath, "wb") as target: + shutil.copyfileobj(optionsFile, target) + for service, providers in jvmciServices.iteritems(): + fd, tmp = tempfile.mkstemp(prefix=service) + f = os.fdopen(fd, 'w+') + for provider in providers: + f.write(provider + os.linesep) + target = join(servicesDir, service) + f.close() + shutil.move(tmp, target) + if mx.get_os() != 'windows': + os.chmod(target, JDK_UNIX_PERMISSIONS_FILE) + +def _updateJVMCIFiles(jdkDir): + jreJVMCIDir = join(jdkDir, 'jre', 'lib', 'jvmci') + jvmciJars = [join(jreJVMCIDir, e) for e in os.listdir(jreJVMCIDir) if e.endswith('.jar')] + jreJVMCIServicesDir = join(jreJVMCIDir, 'services') + jreJVMCIOptionsDir = join(jreJVMCIDir, 'options') + _extractJVMCIFiles(_getJdkDeployedJars(jdkDir), jvmciJars, jreJVMCIServicesDir, jreJVMCIOptionsDir) + +def _updateGraalPropertiesFile(jreLibDir): + """ + Updates (or creates) 'jreLibDir'/jvmci/graal.properties to set/modify the + graal.version property. + """ + version = graal_version() + graalProperties = join(jreLibDir, 'jvmci', 'graal.properties') + if not exists(graalProperties): + with open(graalProperties, 'w') as fp: + print >> fp, 'graal.version=' + version + else: + content = [] + with open(graalProperties) as fp: + for line in fp: + if line.startswith('graal.version='): + content.append('graal.version=' + version) + else: + content.append(line.rstrip(os.linesep)) + with open(graalProperties, 'w') as fp: + fp.write(os.linesep.join(content)) + +def _installDistInJdks(deployableDist): + """ + Installs the jar(s) for a given Distribution into all existing JVMCI JDKs + """ + dist = mx.distribution(deployableDist.name) + jdks = _jdksDir() + if exists(jdks): + for e in os.listdir(jdks): + jdkDir = join(jdks, e) + jreLibDir = join(jdkDir, 'jre', 'lib') + if exists(jreLibDir): + if deployableDist.isExtension: + targetDir = join(jreLibDir, 'ext') + elif deployableDist.usesJVMCIClassLoader: + targetDir = join(jreLibDir, 'jvmci') + else: + targetDir = jreLibDir + if not exists(targetDir): + os.makedirs(targetDir) + _copyToJdk(dist.path, targetDir) + if dist.sourcesPath: + _copyToJdk(dist.sourcesPath, jdkDir) + if deployableDist.usesJVMCIClassLoader: + # deploy service files + _updateJVMCIFiles(jdkDir) + if dist.name == 'GRAAL': + _updateGraalPropertiesFile(jreLibDir) + +def _getJdkDeployedJars(jdkDir): + """ + Gets jar paths for all deployed distributions in the context of + a given JDK directory. + """ + jreLibDir = join(jdkDir, 'jre', 'lib') + jars = [] + for dist in _jdkDeployedDists: + jar = basename(mx.distribution(dist.name).path) + if dist.isExtension: + jars.append(join(jreLibDir, 'ext', jar)) + elif dist.usesJVMCIClassLoader: + jars.append(join(jreLibDir, 'jvmci', jar)) + else: + jars.append(join(jreLibDir, jar)) + return jars + + +# run a command in the windows SDK Debug Shell +def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo=None): + if respondTo is None: + respondTo = {} + newLine = os.linesep + startToken = 'RUNINDEBUGSHELL_STARTSEQUENCE' + endToken = 'RUNINDEBUGSHELL_ENDSEQUENCE' + + winSDK = mx.get_env('WIN_SDK', 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\') + + if not exists(mx._cygpathW2U(winSDK)): + mx.abort("Could not find Windows SDK : '" + winSDK + "' does not exist") + + winSDKSetEnv = mx._cygpathW2U(join(winSDK, 'Bin', 'SetEnv.cmd')) + if not exists(winSDKSetEnv): + mx.abort("Invalid Windows SDK path (" + winSDK + ") : could not find Bin/SetEnv.cmd (you can use the WIN_SDK environment variable to specify an other path)") + + wincmd = 'cmd.exe /E:ON /V:ON /K "' + mx._cygpathU2W(winSDKSetEnv) + '"' + p = subprocess.Popen(wincmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout = p.stdout + stdin = p.stdin + if logFile: + log = open(logFile, 'w') + ret = False + + def _writeProcess(s): + stdin.write(s + newLine) + + _writeProcess("echo " + startToken) + while True: + # encoding may be None on windows plattforms + if sys.stdout.encoding is None: + encoding = 'utf-8' + else: + encoding = sys.stdout.encoding + + line = stdout.readline().decode(encoding) + if logFile: + log.write(line.encode('utf-8')) + line = line.strip() + mx.log(line) + if line == startToken: + _writeProcess('cd /D ' + workingDir + ' & ' + cmd + ' & echo ' + endToken) + for regex in respondTo.keys(): + match = regex.search(line) + if match: + _writeProcess(respondTo[regex]) + if findInOutput: + match = findInOutput.search(line) + if match: + ret = True + if line == endToken: + if not findInOutput: + _writeProcess('echo ERRXXX%errorlevel%') + else: + break + if line.startswith('ERRXXX'): + if line == 'ERRXXX0': + ret = True + break + _writeProcess("exit") + if logFile: + log.close() + return ret + +def jdkhome(vm=None): + """return the JDK directory selected for the 'vm' command""" + return _jdk(installJars=False) + +def print_jdkhome(args, vm=None): + """print the JDK directory selected for the 'vm' command""" + print jdkhome(vm) + +def buildvars(args): + """describe the variables that can be set by the -D option to the 'mx build' commmand""" + + buildVars = { + 'ALT_BOOTDIR' : 'The location of the bootstrap JDK installation (default: ' + mx.java().jdk + ')', + 'ALT_OUTPUTDIR' : 'Build directory', + 'HOTSPOT_BUILD_JOBS' : 'Number of CPUs used by make (default: ' + str(mx.cpu_count()) + ')', + 'INSTALL' : 'Install the built VM into the JDK? (default: y)', + 'ZIP_DEBUGINFO_FILES' : 'Install zipped debug symbols file? (default: 0)', + } + + mx.log('HotSpot build variables that can be set by the -D option to "mx build":') + mx.log('') + for n in sorted(buildVars.iterkeys()): + mx.log(n) + mx.log(textwrap.fill(buildVars[n], initial_indent=' ', subsequent_indent=' ', width=200)) + + mx.log('') + mx.log('Note that these variables can be given persistent values in the file ' + join(_suite.mxDir, 'env') + ' (see \'mx about\').') + +cached_graal_version = None + +def graal_version(dev_suffix='dev'): + global cached_graal_version + + if not cached_graal_version: + # extract latest release tag for graal + try: + tags = [x.split() for x in subprocess.check_output(['hg', '-R', _graal_home, 'tags']).split('\n') if x.startswith("graal-")] + current_id = subprocess.check_output(['hg', '-R', _graal_home, 'log', '--template', '{rev}\n', '--rev', 'tip']).strip() + except: + # not a mercurial repository or hg commands are not available. + tags = None + + if tags and current_id: + sorted_tags = sorted(tags, key=lambda e: [int(x) for x in e[0][len("graal-"):].split('.')], reverse=True) + most_recent_tag_name, most_recent_tag_revision = sorted_tags[0] + most_recent_tag_id = most_recent_tag_revision[:most_recent_tag_revision.index(":")] + most_recent_tag_version = most_recent_tag_name[len("graal-"):] + + # tagged commit is one-off with commit that tags it + if int(current_id) - int(most_recent_tag_id) <= 1: + cached_graal_version = most_recent_tag_version + else: + major, minor = map(int, most_recent_tag_version.split('.')) + cached_graal_version = str(major) + '.' + str(minor + 1) + '-' + dev_suffix + else: + cached_graal_version = 'unknown-{0}-{1}'.format(platform.node(), time.strftime('%Y-%m-%d_%H-%M-%S_%Z')) + + return cached_graal_version + +def build(args, vm=None): + """build the VM binary + + The global '--vm' and '--vmbuild' options select which VM type and build target to build.""" + + # Override to fail quickly if extra arguments are given + # at the end of the command line. This allows for a more + # helpful error message. + class AP(ArgumentParser): + def __init__(self): + ArgumentParser.__init__(self, prog='mx build') + def parse_args(self, args): + result = ArgumentParser.parse_args(self, args) + if len(result.remainder) != 0: + firstBuildTarget = result.remainder[0] + mx.abort('To specify the ' + firstBuildTarget + ' VM build target, you need to use the global "--vmbuild" option. For example:\n' + + ' mx --vmbuild ' + firstBuildTarget + ' build') + return result + + # Call mx.build to compile the Java sources + parser = AP() + parser.add_argument('-D', action='append', help='set a HotSpot build variable (run \'mx buildvars\' to list variables)', metavar='name=value') + + opts2 = mx.build(['--source', '1.7'] + args, parser=parser) + assert len(opts2.remainder) == 0 + + if not opts2.native: + return + + builds = [_vmbuild] + + if os.environ.get('BUILDING_FROM_IDE', None) == 'true': + build = os.environ.get('IDE_BUILD_TARGET', None) + if build is None or len(build) == 0: + return + if build not in _vmbuildChoices: + mx.abort('VM build "' + build + '" specified by IDE_BUILD_TARGET environment variable is unknown (must be one of ' + + str(_vmbuildChoices) + ')') + builds = [build] + + if vm is None: + vm = _get_vm() + + if vm == 'original': + pass + elif vm.startswith('server'): + buildSuffix = '' + elif vm.startswith('client'): + buildSuffix = '1' + else: + assert vm == 'jvmci', vm + buildSuffix = 'jvmci' + + if _installed_jdks and _installed_jdks != _graal_home: + if not mx.ask_yes_no("Warning: building while --installed-jdks is set (" + _installed_jdks + ") is not recommanded - are you sure you want to continue", 'n'): + mx.abort(1) + + isWindows = platform.system() == 'Windows' or "CYGWIN" in platform.system() + for build in builds: + installJars = vm != 'original' and (isWindows or not opts2.java) + jdk = _jdk(build, create=True, installJars=installJars) + + if vm == 'original': + if build != 'product': + mx.log('only product build of original VM exists') + continue + + if not isVMSupported(vm): + mx.log('The ' + vm + ' VM is not supported on this platform - skipping') + continue + + vmDir = join(_vmLibDirInJdk(jdk), vm) + if not exists(vmDir): + chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) + mx.log('Creating VM directory in JDK: ' + vmDir) + os.makedirs(vmDir) + + def filterXusage(line): + if not 'Xusage.txt' in line: + sys.stderr.write(line + os.linesep) + + # Check if a build really needs to be done + timestampFile = join(vmDir, '.build-timestamp') + if opts2.force or not exists(timestampFile): + mustBuild = True + else: + mustBuild = False + timestamp = os.path.getmtime(timestampFile) + sources = [] + for d in ['src', 'make', join('jvmci', 'com.oracle.jvmci.hotspot', 'src_gen', 'hotspot')]: + for root, dirnames, files in os.walk(join(_graal_home, d)): + # ignore <graal>/src/share/tools + if root == join(_graal_home, 'src', 'share'): + dirnames.remove('tools') + sources += [join(root, name) for name in files] + for f in sources: + if len(f) != 0 and os.path.getmtime(f) > timestamp: + mustBuild = True + break + + if not mustBuild: + mx.logv('[all files in src and make directories are older than ' + timestampFile[len(_graal_home) + 1:] + ' - skipping native build]') + continue + + if isWindows: + t_compilelogfile = mx._cygpathU2W(os.path.join(_graal_home, "graalCompile.log")) + mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin') + + variant = {'client': 'compiler1', 'server': 'compiler2'}.get(vm, vm) + project_config = variant + '_' + build + t_graal_home = mx._cygpathU2W(_graal_home) + _runInDebugShell('msbuild ' + t_graal_home + r'\build\vs-amd64\jvm.vcproj /p:Configuration=' + project_config + ' /target:clean', t_graal_home) + winCompileCmd = r'set HotSpotMksHome=' + mksHome + r'& set OUT_DIR=' + mx._cygpathU2W(jdk) + r'& set JAVA_HOME=' + mx._cygpathU2W(jdk) + r'& set path=%JAVA_HOME%\bin;%path%;%HotSpotMksHome%& cd /D "' + t_graal_home + r'\make\windows"& call create.bat ' + t_graal_home + print winCompileCmd + winCompileSuccess = re.compile(r"^Writing \.vcxproj file:") + if not _runInDebugShell(winCompileCmd, t_graal_home, t_compilelogfile, winCompileSuccess): + mx.log('Error executing create command') + return + winBuildCmd = 'msbuild ' + t_graal_home + r'\build\vs-amd64\jvm.vcxproj /p:Configuration=' + project_config + ' /p:Platform=x64' + if not _runInDebugShell(winBuildCmd, t_graal_home, t_compilelogfile): + mx.log('Error building project') + return + else: + cpus = mx.cpu_count() + makeDir = join(_graal_home, 'make') + runCmd = [mx.gmake_cmd(), '-C', makeDir] + + env = os.environ.copy() + + # These must be passed as environment variables + env.setdefault('LANG', 'C') + env['JAVA_HOME'] = jdk + + def setMakeVar(name, default, env=None): + """Sets a make variable on the command line to the value + of the variable in 'env' with the same name if defined + and 'env' is not None otherwise to 'default' + """ + runCmd.append(name + '=' + (env.get(name, default) if env else default)) + + if opts2.D: + for nv in opts2.D: + name, value = nv.split('=', 1) + setMakeVar(name.strip(), value) + + setMakeVar('ARCH_DATA_MODEL', '64', env=env) + setMakeVar('HOTSPOT_BUILD_JOBS', str(cpus), env=env) + setMakeVar('ALT_BOOTDIR', mx.java().jdk, env=env) + setMakeVar("EXPORT_PATH", jdk) + + setMakeVar('MAKE_VERBOSE', 'y' if mx._opts.verbose else '') + if vm.endswith('nojvmci'): + setMakeVar('INCLUDE_JVMCI', 'false') + setMakeVar('ALT_OUTPUTDIR', join(_graal_home, 'build-nojvmci', mx.get_os()), env=env) + else: + version = graal_version() + setMakeVar('USER_RELEASE_SUFFIX', 'jvmci-' + version) + setMakeVar('INCLUDE_JVMCI', 'true') + setMakeVar('INSTALL', 'y', env=env) + if mx.get_os() == 'darwin' and platform.mac_ver()[0] != '': + # Force use of clang on MacOS + setMakeVar('USE_CLANG', 'true') + if mx.get_os() == 'solaris': + # If using sparcWorks, setup flags to avoid make complaining about CC version + cCompilerVersion = subprocess.Popen('CC -V', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).stderr.readlines()[0] + if cCompilerVersion.startswith('CC: Sun C++'): + compilerRev = cCompilerVersion.split(' ')[3] + setMakeVar('ENFORCE_COMPILER_REV', compilerRev, env=env) + setMakeVar('ENFORCE_CC_COMPILER_REV', compilerRev, env=env) + if build == 'jvmg': + # We want ALL the symbols when debugging on Solaris + setMakeVar('STRIP_POLICY', 'no_strip') + # This removes the need to unzip the *.diz files before debugging in gdb + setMakeVar('ZIP_DEBUGINFO_FILES', '0', env=env) + + if buildSuffix == "1": + setMakeVar("BUILD_CLIENT_ONLY", "true") + + # Clear this variable as having it set can cause very confusing build problems + env.pop('CLASSPATH', None) + + # Issue an env prefix that can be used to run the make on the command line + if not mx._opts.verbose: + mx.log('--------------- make command line ----------------------') + + envPrefix = ' '.join([key + '=' + env[key] for key in env.iterkeys() if not os.environ.has_key(key) or env[key] != os.environ[key]]) + if len(envPrefix): + mx.log('env ' + envPrefix + ' \\') + + runCmd.append(build + buildSuffix) + runCmd.append("docs") + runCmd.append("export_" + build) + + if not mx._opts.verbose: + mx.log(' '.join(runCmd)) + mx.log('--------------------------------------------------------') + mx.run(runCmd, err=filterXusage, env=env) + + jvmCfg = _vmCfgInJdk(jdk) + if not exists(jvmCfg): + mx.abort(jvmCfg + ' does not exist') + + prefix = '-' + vm + ' ' + vmKnown = prefix + 'KNOWN\n' + lines = [] + found = False + with open(jvmCfg) as f: + for line in f: + if line.strip() == vmKnown.strip(): + found = True + lines.append(line) + + if not found: + mx.log('Prepending "' + prefix + 'KNOWN" to ' + jvmCfg) + if mx.get_os() != 'windows': + os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) + with open(jvmCfg, 'w') as f: + written = False + for line in lines: + if line.startswith('#'): + f.write(line) + continue + if not written: + f.write(vmKnown) + if vm == 'jvmci': + # Legacy support + f.write('-graal ALIASED_TO -jvmci\n') + written = True + if line.startswith(prefix): + line = vmKnown + if written: + continue + f.write(line) + + for jdkDist in _jdkDeployedDists: # Install non HotSpot distribution + if not jdkDist.partOfHotSpot: + _installDistInJdks(jdkDist) + if exists(timestampFile): + os.utime(timestampFile, None) + else: + file(timestampFile, 'a') + +def vmg(args): + """run the debug build of VM selected by the '--vm' option""" + return vm(args, vmbuild='debug') + +def vmfg(args): + """run the fastdebug build of VM selected by the '--vm' option""" + return vm(args, vmbuild='fastdebug') + +def _parseVmArgs(args, vm=None, cwd=None, vmbuild=None): + """run the VM selected by the '--vm' option""" + + if vm is None: + vm = _get_vm() + + if not isVMSupported(vm): + mx.abort('The ' + vm + ' is not supported on this platform') + + if cwd is None: + cwd = _vm_cwd + elif _vm_cwd is not None and _vm_cwd != cwd: + mx.abort("conflicting working directories: do not set --vmcwd for this command") + + build = vmbuild if vmbuild else _vmbuild + jdk = _jdk(build, vmToCheck=vm, installJars=False) + _updateInstalledJVMCIOptionsFile(jdk) + mx.expand_project_in_args(args) + if _make_eclipse_launch: + mx.make_eclipse_launch(_suite, args, 'graal-' + build, name=None, deps=mx.project('com.oracle.graal.hotspot').all_deps([], True)) + if _jacoco == 'on' or _jacoco == 'append': + jacocoagent = mx.library("JACOCOAGENT", True) + # Exclude all compiler tests and snippets + + includes = ['com.oracle.graal.*', 'com.oracle.jvmci.*'] + baseExcludes = [] + for p in mx.projects(): + projsetting = getattr(p, 'jacoco', '') + if projsetting == 'exclude': + baseExcludes.append(p.name) + if projsetting == 'include': + includes.append(p.name + '.*') + + def _filter(l): + # filter out specific classes which are already covered by a baseExclude package + return [clazz for clazz in l if not any([clazz.startswith(package) for package in baseExcludes])] + excludes = [] + for p in mx.projects(): + excludes += _filter(_find_classes_with_annotations(p, None, ['@Snippet', '@ClassSubstitution', '@Test'], includeInnerClasses=True).keys()) + excludes += _filter(p.find_classes_with_matching_source_line(None, lambda line: 'JaCoCo Exclude' in line, includeInnerClasses=True).keys()) + + excludes += [package + '.*' for package in baseExcludes] + agentOptions = { + 'append' : 'true' if _jacoco == 'append' else 'false', + 'bootclasspath' : 'true', + 'includes' : ':'.join(includes), + 'excludes' : ':'.join(excludes), + 'destfile' : 'jacoco.exec' + } + args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args + exe = join(jdk, 'bin', mx.exe_suffix('java')) + pfx = _vm_prefix.split() if _vm_prefix is not None else [] + + if '-version' in args: + ignoredArgs = args[args.index('-version') + 1:] + if len(ignoredArgs) > 0: + mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs)) + + # Unconditionally prepend Truffle to the boot class path. + # This used to be done by the VM itself but was removed to + # separate the VM from Truffle. + truffle_jar = mx.archive(['@TRUFFLE'])[0] + args = ['-Xbootclasspath/p:' + truffle_jar] + args + + args = mx.java().processArgs(args) + return (pfx, exe, vm, args, cwd) + +def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None): + (pfx_, exe_, vm_, args_, cwd) = _parseVmArgs(args, vm, cwd, vmbuild) + return mx.run(pfx_ + [exe_, '-' + vm_] + args_, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout) + +def _find_classes_with_annotations(p, pkgRoot, annotations, includeInnerClasses=False): + """ + Scan the sources of project 'p' for Java source files containing a line starting with 'annotation' + (ignoring preceding whitespace) and return the fully qualified class name for each Java + source file matched in a list. + """ + + matches = lambda line: len([a for a in annotations if line == a or line.startswith(a + '(')]) != 0 + return p.find_classes_with_matching_source_line(pkgRoot, matches, includeInnerClasses) + +def _find_classpath_arg(vmArgs): + for index in range(len(vmArgs)): + if vmArgs[index] in ['-cp', '-classpath']: + return index + 1, vmArgs[index + 1] + +def unittest(args): + def vmLauncher(vmArgs, mainClass, mainClassArgs): + if isJVMCIEnabled(_get_vm()): + # Remove entries from class path that are in JVMCI loaded jars + cpIndex, cp = _find_classpath_arg(vmArgs) + if cp: + excluded = set() + for jdkDist in _jdkDeployedDists: + dist = mx.distribution(jdkDist.name) + excluded.update([d.output_dir() for d in dist.sorted_deps()]) + cp = os.pathsep.join([e for e in cp.split(os.pathsep) if e not in excluded]) + vmArgs[cpIndex] = cp + + # Run the VM in a mode where application/test classes can + # access JVMCI loaded classes. + vmArgs = ['-XX:-UseJVMCIClassLoader'] + vmArgs + + vm(vmArgs + [mainClass] + mainClassArgs) + mx_unittest.unittest(args, vmLauncher=vmLauncher) + +def shortunittest(args): + """alias for 'unittest --whitelist test/whitelist_shortunittest.txt'""" + + args = ['--whitelist', 'test/whitelist_shortunittest.txt'] + args + unittest(args) + +def microbench(args): + """run JMH microbenchmark projects""" + vmArgs, jmhArgs = mx.extract_VM_args(args, useDoubleDash=True) + + # look for -f in JMH arguments + containsF = False + forking = True + for i in range(len(jmhArgs)): + arg = jmhArgs[i] + if arg.startswith('-f'): + containsF = True + if arg == '-f' and (i+1) < len(jmhArgs): + arg += jmhArgs[i+1] + try: + if int(arg[2:]) == 0: + forking = False + except ValueError: + pass + + # default to -f1 if not specified otherwise + if not containsF: + jmhArgs += ['-f1'] + + # find all projects with a direct JMH dependency + jmhProjects = [] + for p in mx.projects(): + if 'JMH' in p.deps: + jmhProjects.append(p.name) + cp = mx.classpath(jmhProjects) + + # execute JMH runner + args = ['-cp', cp] + if not forking: + args += vmArgs + args += ['org.openjdk.jmh.Main'] + if forking: + (_, _, jvm, _, _) = _parseVmArgs(vmArgs) + args += ['--jvmArgsPrepend', ' '.join(['-' + jvm] + vmArgs)] + vm(args + jmhArgs) + +def buildvms(args): + """build one or more VMs in various configurations""" + + vmsDefault = ','.join(_vmChoices.keys()) + vmbuildsDefault = ','.join(_vmbuildChoices) + + parser = ArgumentParser(prog='mx buildvms') + parser.add_argument('--vms', help='a comma separated list of VMs to build (default: ' + vmsDefault + ')', metavar='<args>', default=vmsDefault) + parser.add_argument('--builds', help='a comma separated list of build types (default: ' + vmbuildsDefault + ')', metavar='<args>', default=vmbuildsDefault) + parser.add_argument('--check-distributions', action='store_true', dest='check_distributions', help='check built distributions for overlap') + parser.add_argument('-n', '--no-check', action='store_true', help='omit running "java -version" after each build') + parser.add_argument('-c', '--console', action='store_true', help='send build output to console instead of log file') + + args = parser.parse_args(args) + vms = args.vms.split(',') + builds = args.builds.split(',') + + allStart = time.time() + check_dists_args = ['--check-distributions'] if args.check_distributions else [] + for v in vms: + if not isVMSupported(v): + mx.log('The ' + v + ' VM is not supported on this platform - skipping') + continue + + for vmbuild in builds: + if v == 'original' and vmbuild != 'product': + continue + if not args.console: + logFile = join(v + '-' + vmbuild + '.log') + log = open(join(_graal_home, logFile), 'wb') + start = time.time() + mx.log('BEGIN: ' + v + '-' + vmbuild + '\t(see: ' + logFile + ')') + verbose = ['-v'] if mx._opts.verbose else [] + # Run as subprocess so that output can be directed to a file + cmd = [sys.executable, '-u', join('mxtool', 'mx.py')] + verbose + ['--vm', v, '--vmbuild', vmbuild, 'build'] + check_dists_args + mx.logv("executing command: " + str(cmd)) + subprocess.check_call(cmd, cwd=_graal_home, stdout=log, stderr=subprocess.STDOUT) + duration = datetime.timedelta(seconds=time.time() - start) + mx.log('END: ' + v + '-' + vmbuild + '\t[' + str(duration) + ']') + else: + with VM(v, vmbuild): + build(check_dists_args) + if not args.no_check: + vmargs = ['-version'] + if v == 'jvmci': + vmargs.insert(0, '-XX:-BootstrapJVMCI') + vm(vmargs, vm=v, vmbuild=vmbuild) + allDuration = datetime.timedelta(seconds=time.time() - allStart) + mx.log('TOTAL TIME: ' + '[' + str(allDuration) + ']') + +class Task: + # None or a list of strings. If not None, only tasks whose title + # matches at least one of the substrings in this list will return + # a non-None value from __enter__. The body of a 'with Task(...) as t' + # statement should check 't' and exit immediately if it is None. + filters = None + filtersExclude = False + + def __init__(self, title, tasks=None): + self.tasks = tasks + self.title = title + if tasks is not None and Task.filters is not None: + if Task.filtersExclude: + self.skipped = any([f in title for f in Task.filters]) + else: + self.skipped = not any([f in title for f in Task.filters]) + else: + self.skipped = False + if not self.skipped: + self.start = time.time() + self.end = None + self.duration = None + mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: BEGIN: ') + title) + def __enter__(self): + assert self.tasks is not None, "using Task with 'with' statement requires to pass the tasks list in the constructor" + if self.skipped: + return None + return self + def __exit__(self, exc_type, exc_value, traceback): + if not self.skipped: + self.tasks.append(self.stop()) + def stop(self): + self.end = time.time() + self.duration = datetime.timedelta(seconds=self.end - self.start) + mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: END: ') + self.title + ' [' + str(self.duration) + ']') + return self + def abort(self, codeOrMessage): + self.end = time.time() + self.duration = datetime.timedelta(seconds=self.end - self.start) + mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: ABORT: ') + self.title + ' [' + str(self.duration) + ']') + mx.abort(codeOrMessage) + return self + +def ctw(args): + """run CompileTheWorld""" + + defaultCtwopts = '-Inline' + + parser = ArgumentParser(prog='mx ctw') + parser.add_argument('--ctwopts', action='store', help='space separated JVMCI options used for CTW compilations (default: --ctwopts="' + defaultCtwopts + '")', default=defaultCtwopts, metavar='<options>') + parser.add_argument('--jar', action='store', help='jar of classes to compiled instead of rt.jar', metavar='<path>') + + args, vmargs = parser.parse_known_args(args) + + if args.ctwopts: + vmargs.append('-G:CompileTheWorldConfig=' + args.ctwopts) + + if args.jar: + jar = os.path.abspath(args.jar) + else: + jar = join(_jdk(installJars=False), 'jre', 'lib', 'rt.jar') + vmargs.append('-G:CompileTheWorldExcludeMethodFilter=sun.awt.X11.*.*') + + vmargs += ['-XX:+CompileTheWorld'] + vm_ = _get_vm() + if isJVMCIEnabled(vm_): + if vm_ == 'jvmci': + vmargs += ['-XX:+BootstrapJVMCI'] + vmargs += ['-G:CompileTheWorldClasspath=' + jar] + else: + vmargs += ['-Xbootclasspath/p:' + jar] + + # suppress menubar and dock when running on Mac; exclude x11 classes as they may cause vm crashes (on Solaris) + vmargs = ['-Djava.awt.headless=true'] + vmargs + + vm(vmargs) + +def _basic_gate_body(args, tasks): + # Build server-hosted-jvmci now so we can run the unit tests + with Task('BuildHotSpotJVMCIHosted: product', tasks) as t: + if t: buildvms(['--vms', 'server', '--builds', 'product', '--check-distributions']) + + # Run unit tests on server-hosted-jvmci + with VM('server', 'product'): + with Task('UnitTests:hosted-product', tasks) as t: + if t: unittest(['--enable-timing', '--verbose', '--fail-fast']) + + # Run unit tests on server-hosted-jvmci with -G:+SSA_LIR + with VM('server', 'product'): + with Task('UnitTestsSSA:hosted-product', tasks) as t: + if t: unittest(['--enable-timing', '--verbose', '--fail-fast', '-G:+SSA_LIR']) + # Run ctw against rt.jar on server-hosted-jvmci + with VM('server', 'product'): + with Task('CTW:hosted-product', tasks) as t: + if t: ctw(['--ctwopts', '-Inline +ExitVMOnException', '-esa', '-G:+CompileTheWorldMultiThreaded', '-G:-CompileTheWorldVerbose']) + + # Build the other VM flavors + with Task('BuildHotSpotGraalOthers: fastdebug,product', tasks) as t: + if t: buildvms(['--vms', 'jvmci,server', '--builds', 'fastdebug,product', '--check-distributions']) + + with VM('jvmci', 'fastdebug'): + with Task('BootstrapWithSystemAssertions:fastdebug', tasks) as t: + if t: vm(['-esa', '-XX:-TieredCompilation', '-version']) + + with VM('jvmci', 'fastdebug'): + with Task('BootstrapEconomyWithSystemAssertions:fastdebug', tasks) as t: + if t: vm(['-esa', '-XX:-TieredCompilation', '-G:CompilerConfiguration=economy', '-version']) + + with VM('jvmci', 'fastdebug'): + with Task('BootstrapWithSystemAssertionsNoCoop:fastdebug', tasks) as t: + if t: vm(['-esa', '-XX:-TieredCompilation', '-XX:-UseCompressedOops', '-version']) + + with VM('jvmci', 'fastdebug'): + with Task('BootstrapWithExceptionEdges:fastdebug', tasks) as t: + if t: vm(['-esa', '-XX:-TieredCompilation', '-G:+StressInvokeWithExceptionNode', '-version']) + + with VM('jvmci', 'product'): + with Task('BootstrapWithGCVerification:product', tasks) as t: + if t: + out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write + vm(['-XX:-TieredCompilation', '-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out) + + with VM('jvmci', 'product'): + with Task('BootstrapWithG1GCVerification:product', tasks) as t: + if t: + out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write + vm(['-XX:-TieredCompilation', '-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out) + + with VM('jvmci', 'product'): + with Task('BootstrapWithRegisterPressure:product', tasks) as t: + if t: + registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if platform.processor() == 'sparc' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14' + vm(['-XX:-TieredCompilation', '-G:RegisterPressure=' + registers, '-esa', '-version']) + + with VM('jvmci', 'product'): + with Task('BootstrapSSAWithRegisterPressure:product', tasks) as t: + if t: + registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if platform.processor() == 'sparc' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14' + vm(['-XX:-TieredCompilation', '-G:+SSA_LIR', '-G:RegisterPressure=' + registers, '-esa', '-version']) + + with VM('jvmci', 'product'): + with Task('BootstrapWithImmutableCode:product', tasks) as t: + if t: vm(['-XX:-TieredCompilation', '-G:+ImmutableCode', '-G:+VerifyPhases', '-esa', '-version']) + + for vmbuild in ['fastdebug', 'product']: + for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild) + sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild): + with Task(str(test) + ':' + vmbuild, tasks) as t: + if t and not test.test('jvmci'): + t.abort(test.name + ' Failed') + + # ensure -Xbatch still works + with VM('jvmci', 'product'): + with Task('DaCapo_pmd:BatchMode:product', tasks) as t: + if t: dacapo(['-Xbatch', 'pmd']) + + # ensure -Xcomp still works + with VM('jvmci', 'product'): + with Task('XCompMode:product', tasks) as t: + if t: vm(['-Xcomp', '-version']) + + if args.jacocout is not None: + jacocoreport([args.jacocout]) + + global _jacoco + _jacoco = 'off' + + with Task('CleanAndBuildIdealGraphVisualizer', tasks) as t: + if t and platform.processor() != 'sparc': + buildxml = mx._cygpathU2W(join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')) + mx.run(['ant', '-f', buildxml, '-q', 'clean', 'build'], env=_igvBuildEnv()) + + # Prevent JVMCI modifications from breaking the standard builds + if args.buildNonJVMCI: + with Task('BuildHotSpotVarieties', tasks) as t: + if t: + buildvms(['--vms', 'client,server', '--builds', 'fastdebug,product']) + if mx.get_os() not in ['windows', 'cygwin']: + buildvms(['--vms', 'server-nojvmci', '--builds', 'product,optimized']) + + for vmbuild in ['product', 'fastdebug']: + for theVm in ['client', 'server']: + if not isVMSupported(theVm): + mx.log('The ' + theVm + ' VM is not supported on this platform') + continue + with VM(theVm, vmbuild): + with Task('DaCapo_pmd:' + theVm + ':' + vmbuild, tasks) as t: + if t: dacapo(['pmd']) + + with Task('UnitTests:' + theVm + ':' + vmbuild, tasks) as t: + if t: unittest(['-XX:CompileCommand=exclude,*::run*', 'graal.api', 'java.test']) + + +def gate(args, gate_body=_basic_gate_body): + """run the tests used to validate a push + + If this command exits with a 0 exit code, then the source code is in + a state that would be accepted for integration into the main repository.""" + + parser = ArgumentParser(prog='mx gate') + parser.add_argument('-j', '--omit-java-clean', action='store_false', dest='cleanJava', help='omit cleaning Java native code') + parser.add_argument('-n', '--omit-native-clean', action='store_false', dest='cleanNative', help='omit cleaning and building native code') + parser.add_argument('-i', '--omit-ide-clean', action='store_false', dest='cleanIde', help='omit cleaning the ide project files') + parser.add_argument('-g', '--only-build-jvmci', action='store_false', dest='buildNonJVMCI', help='only build the JVMCI VM') + parser.add_argument('-t', '--task-filter', help='comma separated list of substrings to select subset of tasks to be run') + parser.add_argument('-x', action='store_true', help='makes --task-filter an exclusion instead of inclusion filter') + parser.add_argument('--jacocout', help='specify the output directory for jacoco report') + + args = parser.parse_args(args) + + global _jacoco + if args.task_filter: + Task.filters = args.task_filter.split(',') + Task.filtersExclude = args.x + elif args.x: + mx.abort('-x option cannot be used without --task-filter option') + + # Force + if not mx._opts.strict_compliance: + mx.log("[gate] forcing strict compliance") + mx._opts.strict_compliance = True + + tasks = [] + total = Task('Gate') + try: + with Task('Check jvmci.make in sync with suite.py', tasks) as t: + if t: + jvmciMake = join('make', 'jvmci.make') + if mx_graal_makefile.build_makefile(['-o', jvmciMake]) != 0: + t.abort('Rerun "mx makefile -o ' + jvmciMake + ' and check-in the modified ' + jvmciMake) + + with Task('Pylint', tasks) as t: + if t: mx.pylint([]) + + def _clean(name='Clean'): + with Task(name, tasks) as t: + if t: + cleanArgs = [] + if not args.cleanNative: + cleanArgs.append('--no-native') + if not args.cleanJava: + cleanArgs.append('--no-java') + clean(cleanArgs) + _clean() + + with Task('IDEConfigCheck', tasks) as t: + if t: + if args.cleanIde: + mx.ideclean([]) + mx.ideinit([]) + + eclipse_exe = mx.get_env('ECLIPSE_EXE') + if eclipse_exe is not None: + with Task('CodeFormatCheck', tasks) as t: + if t and mx.eclipseformat(['-e', eclipse_exe]) != 0: + t.abort('Formatter modified files - run "mx eclipseformat", check in changes and repush') + + with Task('Canonicalization Check', tasks) as t: + if t: + mx.log(time.strftime('%d %b %Y %H:%M:%S - Ensuring mx/projects files are canonicalized...')) + if mx.canonicalizeprojects([]) != 0: + t.abort('Rerun "mx canonicalizeprojects" and check-in the modified mx/suite*.py files.') + + if mx.get_env('JDT'): + with Task('BuildJavaWithEcj', tasks): + if t: build(['-p', '--no-native', '--jdt-warning-as-error']) + _clean('CleanAfterEcjBuild') + + with Task('BuildJavaWithJavac', tasks): + if t: build(['-p', '--no-native', '--force-javac']) + + with Task('Checkstyle', tasks) as t: + if t and mx.checkstyle([]) != 0: + t.abort('Checkstyle warnings were found') + + with Task('Checkheaders', tasks) as t: + if t and checkheaders([]) != 0: + t.abort('Checkheaders warnings were found') + + with Task('FindBugs', tasks) as t: + if t and findbugs([]) != 0: + t.abort('FindBugs warnings were found') + + if exists('jacoco.exec'): + os.unlink('jacoco.exec') + + if args.jacocout is not None: + _jacoco = 'append' + else: + _jacoco = 'off' + + gate_body(args, tasks) + + except KeyboardInterrupt: + total.abort(1) + + except BaseException as e: + import traceback + traceback.print_exc() + total.abort(str(e)) + + total.stop() + + mx.log('Gate task times:') + for t in tasks: + mx.log(' ' + str(t.duration) + '\t' + t.title) + mx.log(' =======') + mx.log(' ' + str(total.duration)) + + if args.task_filter: + Task.filters = None + +def deoptalot(args): + """bootstrap a fastdebug JVMCI VM with DeoptimizeALot and VerifyOops on + + If the first argument is a number, the process will be repeated + this number of times. All other arguments are passed to the VM.""" + count = 1 + if len(args) > 0 and args[0].isdigit(): + count = int(args[0]) + del args[0] + + for _ in range(count): + if not vm(['-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version'], vmbuild='fastdebug') == 0: + mx.abort("Failed") + +def longtests(args): + + deoptalot(['15', '-Xmx48m']) + + dacapo(['100', 'eclipse', '-esa']) + +def _igvJdk(): + v8u20 = mx.VersionSpec("1.8.0_20") + v8u40 = mx.VersionSpec("1.8.0_40") + v8 = mx.VersionSpec("1.8") + def _igvJdkVersionCheck(version): + return version >= v8 and (version < v8u20 or version >= v8u40) + return mx.java(_igvJdkVersionCheck, versionDescription='>= 1.8 and < 1.8.0u20 or >= 1.8.0u40', purpose="building & running IGV").jdk + +def _igvBuildEnv(): + # When the http_proxy environment variable is set, convert it to the proxy settings that ant needs + env = dict(os.environ) + proxy = os.environ.get('http_proxy') + if not (proxy is None) and len(proxy) > 0: + if '://' in proxy: + # Remove the http:// prefix (or any other protocol prefix) + proxy = proxy.split('://', 1)[1] + # Separate proxy server name and port number + proxyName, proxyPort = proxy.split(':', 1) + proxyEnv = '-DproxyHost="' + proxyName + '" -DproxyPort=' + proxyPort + env['ANT_OPTS'] = proxyEnv + + env['JAVA_HOME'] = _igvJdk() + return env + +def igv(args): + """run the Ideal Graph Visualizer""" + logFile = '.ideal_graph_visualizer.log' + with open(join(_graal_home, logFile), 'w') as fp: + mx.logv('[Ideal Graph Visualizer log is in ' + fp.name + ']') + nbplatform = join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'nbplatform') + + # Remove NetBeans platform if it is earlier than the current supported version + if exists(nbplatform): + updateTrackingFile = join(nbplatform, 'platform', 'update_tracking', 'org-netbeans-core.xml') + if not exists(updateTrackingFile): + mx.log('Could not find \'' + updateTrackingFile + '\', removing NetBeans platform') + shutil.rmtree(nbplatform) + else: + dom = xml.dom.minidom.parse(updateTrackingFile) + currentVersion = mx.VersionSpec(dom.getElementsByTagName('module_version')[0].getAttribute('specification_version')) + supportedVersion = mx.VersionSpec('3.43.1') + if currentVersion < supportedVersion: + mx.log('Replacing NetBeans platform version ' + str(currentVersion) + ' with version ' + str(supportedVersion)) + shutil.rmtree(nbplatform) + elif supportedVersion < currentVersion: + mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion)) + + if not exists(nbplatform): + mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]') + + env = _igvBuildEnv() + # make the jar for Batik 1.7 available. + env['IGV_BATIK_JAR'] = mx.library('BATIK').get_path(True) + if mx.run(['ant', '-f', mx._cygpathU2W(join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')), '-l', mx._cygpathU2W(fp.name), 'run'], env=env, nonZeroIsFatal=False): + mx.abort("IGV ant build & launch failed. Check '" + logFile + "'. You can also try to delete 'src/share/tools/IdealGraphVisualizer/nbplatform'.") + +def c1visualizer(args): + """run the Cl Compiler Visualizer""" + libpath = join(_graal_home, 'lib') + if mx.get_os() == 'windows': + executable = join(libpath, 'c1visualizer', 'bin', 'c1visualizer.exe') + else: + executable = join(libpath, 'c1visualizer', 'bin', 'c1visualizer') + + # Check whether the current C1Visualizer installation is the up-to-date + if exists(executable) and not exists(mx.library('C1VISUALIZER_DIST').get_path(resolve=False)): + mx.log('Updating C1Visualizer') + shutil.rmtree(join(libpath, 'c1visualizer')) + + archive = mx.library('C1VISUALIZER_DIST').get_path(resolve=True) + + if not exists(executable): + zf = zipfile.ZipFile(archive, 'r') + zf.extractall(libpath) + + if not exists(executable): + mx.abort('C1Visualizer binary does not exist: ' + executable) + + if mx.get_os() != 'windows': + # Make sure that execution is allowed. The zip file does not always specfiy that correctly + os.chmod(executable, 0777) + + mx.run([executable]) + +def bench(args): + """run benchmarks and parse their output for results + + Results are JSON formated : {group : {benchmark : score}}.""" + resultFile = None + if '-resultfile' in args: + index = args.index('-resultfile') + if index + 1 < len(args): + resultFile = args[index + 1] + del args[index] + del args[index] + else: + mx.abort('-resultfile must be followed by a file name') + vm = _get_vm() + if len(args) is 0: + args = ['all'] + + vmArgs = [arg for arg in args if arg.startswith('-')] + + def benchmarks_in_group(group): + prefix = group + ':' + return [a[len(prefix):] for a in args if a.startswith(prefix)] + + results = {} + benchmarks = [] + # DaCapo + if 'dacapo' in args or 'all' in args: + benchmarks += sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) + else: + dacapos = benchmarks_in_group('dacapo') + for dacapo in dacapos: + if dacapo not in sanitycheck.dacapoSanityWarmup.keys(): + mx.abort('Unknown DaCapo : ' + dacapo) + iterations = sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark] + if iterations > 0: + benchmarks += [sanitycheck.getDacapo(dacapo, iterations)] + + if 'scaladacapo' in args or 'all' in args: + benchmarks += sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) + else: + scaladacapos = benchmarks_in_group('scaladacapo') + for scaladacapo in scaladacapos: + if scaladacapo not in sanitycheck.dacapoScalaSanityWarmup.keys(): + mx.abort('Unknown Scala DaCapo : ' + scaladacapo) + iterations = sanitycheck.dacapoScalaSanityWarmup[scaladacapo][sanitycheck.SanityCheckLevel.Benchmark] + if iterations > 0: + benchmarks += [sanitycheck.getScalaDacapo(scaladacapo, ['-n', str(iterations)])] + + # Bootstrap + if 'bootstrap' in args or 'all' in args: + benchmarks += sanitycheck.getBootstraps() + # SPECjvm2008 + if 'specjvm2008' in args or 'all' in args: + benchmarks += [sanitycheck.getSPECjvm2008(['-ikv', '-wt', '120', '-it', '120'])] + else: + specjvms = benchmarks_in_group('specjvm2008') + for specjvm in specjvms: + benchmarks += [sanitycheck.getSPECjvm2008(['-ikv', '-wt', '120', '-it', '120', specjvm])] + + if 'specjbb2005' in args or 'all' in args: + benchmarks += [sanitycheck.getSPECjbb2005()] + + if 'specjbb2013' in args: # or 'all' in args //currently not in default set + benchmarks += [sanitycheck.getSPECjbb2013()] + + if 'ctw-full' in args: + benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.Full)) + if 'ctw-noinline' in args: + benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoInline)) + + for test in benchmarks: + for (groupName, res) in test.bench(vm, extraVmOpts=vmArgs).items(): + group = results.setdefault(groupName, {}) + group.update(res) + mx.log(json.dumps(results)) + if resultFile: + with open(resultFile, 'w') as f: + f.write(json.dumps(results)) + +def _get_jmh_path(): + path = mx.get_env('JMH_BENCHMARKS', None) + if not path: + probe = join(dirname(_graal_home), 'java-benchmarks') + if exists(probe): + path = probe + + if not path: + mx.abort("Please set the JMH_BENCHMARKS environment variable to point to the java-benchmarks workspace") + if not exists(path): + mx.abort("The directory denoted by the JMH_BENCHMARKS environment variable does not exist: " + path) + return path + +def makejmhdeps(args): + """creates and installs Maven dependencies required by the JMH benchmarks + + The dependencies are specified by files named pom.mxdeps in the + JMH directory tree. Each such file contains a list of dependencies + defined in JSON format. For example: + + '[{"artifactId" : "compiler.test", "groupId" : "com.oracle.graal", "deps" : ["com.oracle.graal.compiler.test"]}]' + + will result in a dependency being installed in the local Maven repository + that can be referenced in a pom.xml file as follows: + + <dependency> + <groupId>com.oracle.graal</groupId> + <artifactId>compiler.test</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency>""" + + parser = ArgumentParser(prog='mx makejmhdeps') + parser.add_argument('-s', '--settings', help='alternative path for Maven user settings file', metavar='<path>') + parser.add_argument('-p', '--permissive', action='store_true', help='issue note instead of error if a Maven dependency cannot be built due to missing projects/libraries') + args = parser.parse_args(args) + + def makejmhdep(artifactId, groupId, deps): + graalSuite = mx.suite("graal") + path = artifactId + '.jar' + if args.permissive: + allDeps = [] + for name in deps: + dist = mx.distribution(name, fatalIfMissing=False) + if dist: + allDeps = allDeps + [d.name for d in dist.sorted_deps(transitive=True)] + else: + if not mx.project(name, fatalIfMissing=False): + if not mx.library(name, fatalIfMissing=False): + mx.log('Skipping dependency ' + groupId + '.' + artifactId + ' as ' + name + ' cannot be resolved') + return + allDeps.append(name) + d = mx.Distribution(graalSuite, name=artifactId, path=path, sourcesPath=path, deps=allDeps, mainClass=None, excludedDependencies=[], distDependencies=[], javaCompliance=None) + d.make_archive() + cmd = ['mvn', 'install:install-file', '-DgroupId=' + groupId, '-DartifactId=' + artifactId, + '-Dversion=1.0-SNAPSHOT', '-Dpackaging=jar', '-Dfile=' + d.path] + if not mx._opts.verbose: + cmd.append('-q') + if args.settings: + cmd = cmd + ['-s', args.settings] + mx.run(cmd) + os.unlink(d.path) + + jmhPath = _get_jmh_path() + for root, _, filenames in os.walk(jmhPath): + for f in [join(root, n) for n in filenames if n == 'pom.mxdeps']: + mx.logv('[processing ' + f + ']') + try: + with open(f) as fp: + for d in json.load(fp): + artifactId = d['artifactId'] + groupId = d['groupId'] + deps = d['deps'] + makejmhdep(artifactId, groupId, deps) + except ValueError as e: + mx.abort('Error parsing {0}:\n{1}'.format(f, e)) + +def buildjmh(args): + """build the JMH benchmarks""" + + parser = ArgumentParser(prog='mx buildjmh') + parser.add_argument('-s', '--settings', help='alternative path for Maven user settings file', metavar='<path>') + parser.add_argument('-c', action='store_true', dest='clean', help='clean before building') + args = parser.parse_args(args) + + jmhPath = _get_jmh_path() + mx.log('JMH benchmarks: ' + jmhPath) + + # Ensure the mx injected dependencies are up to date + makejmhdeps(['-p'] + (['-s', args.settings] if args.settings else [])) + + timestamp = mx.TimeStampFile(join(_suite.mxDir, 'jmh', jmhPath.replace(os.sep, '_') + '.timestamp')) + mustBuild = args.clean + if not mustBuild: + try: + hgfiles = [join(jmhPath, f) for f in subprocess.check_output(['hg', '-R', jmhPath, 'locate']).split('\n')] + mustBuild = timestamp.isOlderThan(hgfiles) + except: + # not a Mercurial repository or hg commands are not available. + mustBuild = True + + if mustBuild: + buildOutput = [] + def _redirect(x): + if mx._opts.verbose: + mx.log(x[:-1]) + else: + buildOutput.append(x) + env = os.environ.copy() + env['JAVA_HOME'] = _jdk(vmToCheck='server') + env['MAVEN_OPTS'] = '-server -XX:-UseJVMCIClassLoader' + mx.log("Building benchmarks...") + cmd = ['mvn'] + if args.settings: + cmd = cmd + ['-s', args.settings] + if args.clean: + cmd.append('clean') + cmd.append('package') + retcode = mx.run(cmd, cwd=jmhPath, out=_redirect, env=env, nonZeroIsFatal=False) + if retcode != 0: + mx.log(''.join(buildOutput)) + mx.abort(retcode) + timestamp.touch() + else: + mx.logv('[all Mercurial controlled files in ' + jmhPath + ' are older than ' + timestamp.path + ' - skipping build]') + +def jmh(args): + """run the JMH benchmarks + + This command respects the standard --vm and --vmbuild options + for choosing which VM to run the benchmarks with.""" + if '-h' in args: + mx.help_(['jmh']) + mx.abort(1) + + vmArgs, benchmarksAndJsons = mx.extract_VM_args(args) + if isJVMCIEnabled(_get_vm()) and '-XX:-UseJVMCIClassLoader' not in vmArgs: + vmArgs = ['-XX:-UseJVMCIClassLoader'] + vmArgs + + benchmarks = [b for b in benchmarksAndJsons if not b.startswith('{')] + jmhArgJsons = [b for b in benchmarksAndJsons if b.startswith('{')] + jmhOutDir = join(_suite.mxDir, 'jmh') + if not exists(jmhOutDir): + os.makedirs(jmhOutDir) + jmhOut = join(jmhOutDir, 'jmh.out') + jmhArgs = {'-rff' : jmhOut, '-v' : 'EXTRA' if mx._opts.verbose else 'NORMAL'} + + # e.g. '{"-wi" : 20}' + for j in jmhArgJsons: + try: + for n, v in json.loads(j).iteritems(): + if v is None: + del jmhArgs[n] + else: + jmhArgs[n] = v + except ValueError as e: + mx.abort('error parsing JSON input: {0}\n{1}'.format(j, e)) + + jmhPath = _get_jmh_path() + mx.log('Using benchmarks in ' + jmhPath) + + matchedSuites = set() + numBench = [0] + for micros in os.listdir(jmhPath): + absoluteMicro = os.path.join(jmhPath, micros) + if not os.path.isdir(absoluteMicro): + continue + if not micros.startswith("micros-"): + mx.logv('JMH: ignored ' + absoluteMicro + " because it doesn't start with 'micros-'") + continue + + microJar = os.path.join(absoluteMicro, "target", "microbenchmarks.jar") + if not exists(microJar): + mx.log('Missing ' + microJar + ' - please run "mx buildjmh"') + continue + if benchmarks: + def _addBenchmark(x): + if x.startswith("Benchmark:"): + return + match = False + for b in benchmarks: + match = match or (b in x) + + if match: + numBench[0] += 1 + matchedSuites.add(micros) + + mx.run_java(['-jar', microJar, "-l"], cwd=jmhPath, out=_addBenchmark, addDefaultArgs=False) + else: + matchedSuites.add(micros) + + mx.logv("matchedSuites: " + str(matchedSuites)) + plural = 's' if not benchmarks or numBench[0] > 1 else '' + number = str(numBench[0]) if benchmarks else "all" + mx.log("Running " + number + " benchmark" + plural + '...') + + regex = [] + if benchmarks: + regex.append(r".*(" + "|".join(benchmarks) + ").*") + + for suite in matchedSuites: + absoluteMicro = os.path.join(jmhPath, suite) + (pfx, exe, vm, forkedVmArgs, _) = _parseVmArgs(vmArgs) + if pfx: + mx.log("JMH ignores prefix: \"" + ' '.join(pfx) + "\"") + javaArgs = ['-jar', os.path.join(absoluteMicro, "target", "microbenchmarks.jar"), + '--jvm', exe, + '--jvmArgs', ' '.join(["-" + vm] + forkedVmArgs)] + for k, v in jmhArgs.iteritems(): + javaArgs.append(k) + if len(str(v)): + javaArgs.append(str(v)) + mx.run_java(javaArgs + regex, addDefaultArgs=False, cwd=jmhPath) + +def specjvm2008(args): + """run one or more SPECjvm2008 benchmarks""" + + def launcher(bm, harnessArgs, extraVmOpts): + return sanitycheck.getSPECjvm2008(harnessArgs + [bm]).bench(_get_vm(), extraVmOpts=extraVmOpts) + + availableBenchmarks = set(sanitycheck.specjvm2008Names) + for name in sanitycheck.specjvm2008Names: + parts = name.rsplit('.', 1) + if len(parts) > 1: + assert len(parts) == 2 + group = parts[0] + availableBenchmarks.add(group) + + _run_benchmark(args, sorted(availableBenchmarks), launcher) + +def specjbb2013(args): + """run the composite SPECjbb2013 benchmark""" + + def launcher(bm, harnessArgs, extraVmOpts): + assert bm is None + return sanitycheck.getSPECjbb2013(harnessArgs).bench(_get_vm(), extraVmOpts=extraVmOpts) + + _run_benchmark(args, None, launcher) + +def specjbb2005(args): + """run the composite SPECjbb2005 benchmark""" + + def launcher(bm, harnessArgs, extraVmOpts): + assert bm is None + return sanitycheck.getSPECjbb2005(harnessArgs).bench(_get_vm(), extraVmOpts=extraVmOpts) + + _run_benchmark(args, None, launcher) + +def hsdis(args, copyToDir=None): + """download the hsdis library + + This is needed to support HotSpot's assembly dumping features. + By default it downloads the Intel syntax version, use the 'att' argument to install AT&T syntax.""" + flavor = 'intel' + if 'att' in args: + flavor = 'att' + if mx.get_arch() == "sparcv9": + flavor = "sparcv9" + lib = mx.add_lib_suffix('hsdis-' + mx.get_arch()) + path = join(_graal_home, 'lib', lib) + + sha1s = { + 'att/hsdis-amd64.dll' : 'bcbd535a9568b5075ab41e96205e26a2bac64f72', + 'att/hsdis-amd64.so' : '58919ba085d4ef7a513f25bae75e7e54ee73c049', + 'intel/hsdis-amd64.dll' : '6a388372cdd5fe905c1a26ced614334e405d1f30', + 'intel/hsdis-amd64.so' : '844ed9ffed64fe9599638f29a8450c50140e3192', + 'intel/hsdis-amd64.dylib' : 'fdb13ef0d7d23d93dacaae9c98837bea0d4fc5a2', + 'sparcv9/hsdis-sparcv9.so': '970640a9af0bd63641f9063c11275b371a59ee60', + } + + flavoredLib = flavor + "/" + lib + if flavoredLib not in sha1s: + mx.logv("hsdis not supported on this plattform or architecture") + return + + if not exists(path): + sha1 = sha1s[flavoredLib] + sha1path = path + '.sha1' + mx.download_file_with_sha1('hsdis', path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavoredLib], sha1, sha1path, True, True, sources=False) + if copyToDir is not None and exists(copyToDir): + shutil.copy(path, copyToDir) + +def hcfdis(args): + """disassemble HexCodeFiles embedded in text files + + Run a tool over the input files to convert all embedded HexCodeFiles + to a disassembled format.""" + + parser = ArgumentParser(prog='mx hcfdis') + parser.add_argument('-m', '--map', help='address to symbol map applied to disassembler output') + parser.add_argument('files', nargs=REMAINDER, metavar='files...') + + args = parser.parse_args(args) + + path = mx.library('HCFDIS').get_path(resolve=True) + mx.run_java(['-cp', path, 'com.oracle.max.hcfdis.HexCodeFileDis'] + args.files) + + if args.map is not None: + addressRE = re.compile(r'0[xX]([A-Fa-f0-9]+)') + with open(args.map) as fp: + lines = fp.read().splitlines() + symbols = dict() + for l in lines: + addressAndSymbol = l.split(' ', 1) + if len(addressAndSymbol) == 2: + address, symbol = addressAndSymbol + if address.startswith('0x'): + address = long(address, 16) + symbols[address] = symbol + for f in args.files: + with open(f) as fp: + lines = fp.read().splitlines() + updated = False + for i in range(0, len(lines)): + l = lines[i] + for m in addressRE.finditer(l): + sval = m.group(0) + val = long(sval, 16) + sym = symbols.get(val) + if sym: + l = l.replace(sval, sym) + updated = True + lines[i] = l + if updated: + mx.log('updating ' + f) + with open('new_' + f, "w") as fp: + for l in lines: + print >> fp, l + +def jacocoreport(args): + """create a JaCoCo coverage report + + Creates the report from the 'jacoco.exec' file in the current directory. + Default output directory is 'coverage', but an alternative can be provided as an argument.""" + jacocoreport = mx.library("JACOCOREPORT", True) + out = 'coverage' + if len(args) == 1: + out = args[0] + elif len(args) > 1: + mx.abort('jacocoreport takes only one argument : an output directory') + + includes = ['com.oracle.graal', 'com.oracle.jvmci'] + for p in mx.projects(): + projsetting = getattr(p, 'jacoco', '') + if projsetting == 'include': + includes.append(p.name) + + includedirs = set() + for p in mx.projects(): + projsetting = getattr(p, 'jacoco', '') + if projsetting == 'exclude': + continue + for include in includes: + if include in p.dir: + includedirs.add(p.dir) + + for i in includedirs: + bindir = i + '/bin' + if not os.path.exists(bindir): + os.makedirs(bindir) + + mx.run_java(['-jar', jacocoreport.get_path(True), '--in', 'jacoco.exec', '--out', out] + sorted(includedirs)) + +def sl(args): + """run an SL program""" + vmArgs, slArgs = mx.extract_VM_args(args) + vm(vmArgs + ['-cp', mx.classpath(["TRUFFLE", "com.oracle.truffle.sl"]), "com.oracle.truffle.sl.SLLanguage"] + slArgs) + +def sldebug(args): + """run a simple command line debugger for the Simple Language""" + vmArgs, slArgs = mx.extract_VM_args(args, useDoubleDash=True) + vm(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl.tools"), "com.oracle.truffle.sl.tools.debug.SLREPLServer"] + slArgs) + +def isJVMCIEnabled(vm): + return vm != 'original' and not vm.endswith('nojvmci') + +def jol(args): + """Java Object Layout""" + joljar = mx.library('JOL_INTERNALS').get_path(resolve=True) + candidates = mx.findclass(args, logToConsole=False, matcher=lambda s, classname: s == classname or classname.endswith('.' + s) or classname.endswith('$' + s)) + + if len(candidates) > 0: + candidates = mx.select_items(sorted(candidates)) + else: + # mx.findclass can be mistaken, don't give up yet + candidates = args + + vm(['-javaagent:' + joljar, '-cp', os.pathsep.join([mx.classpath(), joljar]), "org.openjdk.jol.MainObjectInternals"] + candidates) + +def site(args): + """create a website containing javadoc and the project dependency graph""" + + return mx.site(['--name', 'Graal', + '--jd', '@-tag', '--jd', '@test:X', + '--jd', '@-tag', '--jd', '@run:X', + '--jd', '@-tag', '--jd', '@bug:X', + '--jd', '@-tag', '--jd', '@summary:X', + '--jd', '@-tag', '--jd', '@vmoption:X', + '--overview', join(_graal_home, 'graal', 'overview.html'), + '--title', 'Graal OpenJDK Project Documentation', + '--dot-output-base', 'projects'] + args) + +def generateZshCompletion(args): + """generate zsh completion for mx""" + try: + from genzshcomp import CompletionGenerator + except ImportError: + mx.abort("install genzshcomp (pip install genzshcomp)") + + # need to fake module for the custom mx arg parser, otherwise a check in genzshcomp fails + originalModule = mx._argParser.__module__ + mx._argParser.__module__ = "argparse" + generator = CompletionGenerator("mx", mx._argParser) + mx._argParser.__module__ = originalModule + + # strip last line and define local variable "ret" + complt = "\n".join(generator.get().split('\n')[0:-1]).replace('context state line', 'context state line ret=1') + + # add array of possible subcommands (as they are not part of the argument parser) + complt += '\n ": :->command" \\\n' + complt += ' "*::args:->args" && ret=0\n' + complt += '\n' + complt += 'case $state in\n' + complt += '\t(command)\n' + complt += '\t\tlocal -a main_commands\n' + complt += '\t\tmain_commands=(\n' + for cmd in sorted(mx._commands.iterkeys()): + c, _ = mx._commands[cmd][:2] + doc = c.__doc__ + complt += '\t\t\t"{0}'.format(cmd) + if doc: + complt += ':{0}'.format(_fixQuotes(doc.split('\n', 1)[0])) + complt += '"\n' + complt += '\t\t)\n' + complt += '\t\t_describe -t main_commands command main_commands && ret=0\n' + complt += '\t\t;;\n' + + complt += '\t(args)\n' + # TODO: improve matcher: if mx args are given, this doesn't work + complt += '\t\tcase $line[1] in\n' + complt += '\t\t\t(vm | vmg | vmfg | unittest | jmh | dacapo | scaladacapo | specjvm2008 | specjbb2013 | specjbb2005)\n' + complt += '\t\t\t\tnoglob \\\n' + complt += '\t\t\t\t\t_arguments -s -S \\\n' + complt += _appendOptions("jvmci", r"G\:") + # TODO: fix -XX:{-,+}Use* flags + complt += _appendOptions("hotspot", r"XX\:") + complt += '\t\t\t\t\t"-version" && ret=0 \n' + complt += '\t\t\t\t;;\n' + complt += '\t\tesac\n' + complt += '\t\t;;\n' + complt += 'esac\n' + complt += '\n' + complt += 'return $ret' + print complt + +def _fixQuotes(arg): + return arg.replace('\"', '').replace('\'', '').replace('`', '').replace('{', '\\{').replace('}', '\\}').replace('[', '\\[').replace(']', '\\]') + +def _appendOptions(optionType, optionPrefix): + def isBoolean(vmap, field): + return vmap[field] == "Boolean" or vmap[field] == "bool" + + def hasDescription(vmap): + return vmap['optDefault'] or vmap['optDoc'] + + complt = "" + for vmap in _parseVMOptions(optionType): + complt += '\t\t\t\t\t-"' + complt += optionPrefix + if isBoolean(vmap, 'optType'): + complt += '"{-,+}"' + complt += vmap['optName'] + if not isBoolean(vmap, 'optType'): + complt += '=' + if hasDescription(vmap): + complt += "[" + if vmap['optDefault']: + complt += r"(default\: " + vmap['optDefault'] + ")" + if vmap['optDoc']: + complt += _fixQuotes(vmap['optDoc']) + if hasDescription(vmap): + complt += "]" + complt += '" \\\n' + return complt + +def _parseVMOptions(optionType): + parser = OutputParser() + # TODO: the optDoc part can wrapped accross multiple lines, currently only the first line will be captured + # TODO: fix matching for float literals + jvmOptions = re.compile( + r"^[ \t]*" + r"(?P<optType>(Boolean|Integer|Float|Double|String|bool|intx|uintx|ccstr|double)) " + r"(?P<optName>[a-zA-Z0-9]+)" + r"[ \t]+=[ \t]*" + r"(?P<optDefault>([\-0-9]+(\.[0-9]+(\.[0-9]+\.[0-9]+))?|false|true|null|Name|sun\.boot\.class\.path))?" + r"[ \t]*" + r"(?P<optDoc>.+)?", + re.MULTILINE) + parser.addMatcher(ValuesMatcher(jvmOptions, { + 'optType' : '<optType>', + 'optName' : '<optName>', + 'optDefault' : '<optDefault>', + 'optDoc' : '<optDoc>', + })) + + # gather JVMCI options + output = StringIO.StringIO() + vm(['-XX:-BootstrapJVMCI', '-XX:+UnlockDiagnosticVMOptions', '-G:+PrintFlags' if optionType == "jvmci" else '-XX:+PrintFlagsWithComments'], + vm="jvmci", + vmbuild="optimized", + nonZeroIsFatal=False, + out=output.write, + err=subprocess.STDOUT) + + valueMap = parser.parse(output.getvalue()) + return valueMap + +def findbugs(args): + '''run FindBugs against non-test Java projects''' + findBugsHome = mx.get_env('FINDBUGS_HOME', None) + if findBugsHome: + findbugsJar = join(findBugsHome, 'lib', 'findbugs.jar') + else: + findbugsLib = join(_graal_home, 'lib', 'findbugs-3.0.0') + if not exists(findbugsLib): + tmp = tempfile.mkdtemp(prefix='findbugs-download-tmp', dir=_graal_home) + try: + findbugsDist = mx.library('FINDBUGS_DIST').get_path(resolve=True) + with zipfile.ZipFile(findbugsDist) as zf: + candidates = [e for e in zf.namelist() if e.endswith('/lib/findbugs.jar')] + assert len(candidates) == 1, candidates + libDirInZip = os.path.dirname(candidates[0]) + zf.extractall(tmp) + shutil.copytree(join(tmp, libDirInZip), findbugsLib) + finally: + shutil.rmtree(tmp) + findbugsJar = join(findbugsLib, 'findbugs.jar') + assert exists(findbugsJar) + nonTestProjects = [p for p in mx.projects() if not p.name.endswith('.test') and not p.name.endswith('.jtt')] + outputDirs = map(mx._cygpathU2W, [p.output_dir() for p in nonTestProjects]) + javaCompliance = max([p.javaCompliance for p in nonTestProjects]) + findbugsResults = join(_graal_home, 'findbugs.results') + + cmd = ['-jar', mx._cygpathU2W(findbugsJar), '-textui', '-low', '-maxRank', '15'] + if mx.is_interactive(): + cmd.append('-progress') + cmd = cmd + ['-auxclasspath', mx._separatedCygpathU2W(mx.classpath([d.name for d in _jdkDeployedDists] + [p.name for p in nonTestProjects])), '-output', mx._cygpathU2W(findbugsResults), '-exitcode'] + args + outputDirs + exitcode = mx.run_java(cmd, nonZeroIsFatal=False, javaConfig=mx.java(javaCompliance)) + if exitcode != 0: + with open(findbugsResults) as fp: + mx.log(fp.read()) + os.unlink(findbugsResults) + return exitcode + +def checkheaders(args): + """check Java source headers against any required pattern""" + failures = {} + for p in mx.projects(): + if p.native: + continue + + csConfig = join(mx.project(p.checkstyleProj).dir, '.checkstyle_checks.xml') + if not exists(csConfig): + mx.log('Cannot check headers for ' + p.name + ' - ' + csConfig + ' does not exist') + continue + dom = xml.dom.minidom.parse(csConfig) + for module in dom.getElementsByTagName('module'): + if module.getAttribute('name') == 'RegexpHeader': + for prop in module.getElementsByTagName('property'): + if prop.getAttribute('name') == 'header': + value = prop.getAttribute('value') + matcher = re.compile(value, re.MULTILINE) + for sourceDir in p.source_dirs(): + for root, _, files in os.walk(sourceDir): + for name in files: + if name.endswith('.java') and name != 'package-info.java': + f = join(root, name) + with open(f) as fp: + content = fp.read() + if not matcher.match(content): + failures[f] = csConfig + for n, v in failures.iteritems(): + mx.log('{0}: header does not match RegexpHeader defined in {1}'.format(n, v)) + return len(failures) + +def mx_init(suite): + commands = { + 'build': [build, ''], + 'buildjmh': [buildjmh, '[-options]'], + 'buildvars': [buildvars, ''], + 'buildvms': [buildvms, '[-options]'], + 'c1visualizer' : [c1visualizer, ''], + 'checkheaders': [checkheaders, ''], + 'clean': [clean, ''], + 'ctw': [ctw, '[-vmoptions|noinline|nocomplex|full]'], + 'export': [export, '[-options] [zipfile]'], + 'findbugs': [findbugs, ''], + 'generateZshCompletion' : [generateZshCompletion, ''], + 'hsdis': [hsdis, '[att]'], + 'hcfdis': [hcfdis, ''], + 'igv' : [igv, ''], + 'jdkhome': [print_jdkhome, ''], + 'jmh': [jmh, '[VM options] [filters|JMH-args-as-json...]'], + 'dacapo': [dacapo, '[VM options] benchmarks...|"all" [DaCapo options]'], + 'scaladacapo': [scaladacapo, '[VM options] benchmarks...|"all" [Scala DaCapo options]'], + 'specjvm2008': [specjvm2008, '[VM options] benchmarks...|"all" [SPECjvm2008 options]'], + 'specjbb2013': [specjbb2013, '[VM options] [-- [SPECjbb2013 options]]'], + 'specjbb2005': [specjbb2005, '[VM options] [-- [SPECjbb2005 options]]'], + 'gate' : [gate, '[-options]'], + 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], + 'microbench' : [microbench, '[VM options] [-- [JMH options]]'], + 'makejmhdeps' : [makejmhdeps, ''], + 'unittest' : [unittest, '[unittest options] [--] [VM options] [filters...]', mx_unittest.unittestHelpSuffix], + 'shortunittest' : [shortunittest, '[unittest options] [--] [VM options] [filters...]', mx_unittest.unittestHelpSuffix], + 'jacocoreport' : [jacocoreport, '[output directory]'], + 'site' : [site, '[-options]'], + 'vm': [vm, '[-options] class [args...]'], + 'vmg': [vmg, '[-options] class [args...]'], + 'vmfg': [vmfg, '[-options] class [args...]'], + 'deoptalot' : [deoptalot, '[n]'], + 'longtests' : [longtests, ''], + 'sl' : [sl, '[SL args|@VM options]'], + 'sldebug' : [sldebug, '[SL args|@VM options]'], + 'jol' : [jol, ''], + 'makefile' : [mx_graal_makefile.build_makefile, 'build makefiles for JDK build'], + } + + mx.add_argument('--jacoco', help='instruments com.oracle.* classes using JaCoCo', default='off', choices=['off', 'on', 'append']) + mx.add_argument('--vmcwd', dest='vm_cwd', help='current directory will be changed to <path> before the VM is executed', default=None, metavar='<path>') + mx.add_argument('--installed-jdks', help='the base directory in which the JDKs cloned from $JAVA_HOME exist. ' + + 'The VM selected by --vm and --vmbuild options is under this directory (i.e., ' + + join('<path>', '<jdk-version>', '<vmbuild>', 'jre', 'lib', '<vm>', mx.add_lib_prefix(mx.add_lib_suffix('jvm'))) + ')', default=None, metavar='<path>') + + mx.add_argument('--vm', action='store', dest='vm', choices=_vmChoices.keys(), help='the VM type to build/run') + mx.add_argument('--vmbuild', action='store', dest='vmbuild', choices=_vmbuildChoices, help='the VM build to build/run (default: ' + _vmbuildChoices[0] + ')') + mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse') + mx.add_argument('--vmprefix', action='store', dest='vm_prefix', help='prefix for running the VM (e.g. "/usr/bin/gdb --args")', metavar='<prefix>') + mx.add_argument('--gdb', action='store_const', const='/usr/bin/gdb --args', dest='vm_prefix', help='alias for --vmprefix "/usr/bin/gdb --args"') + mx.add_argument('--lldb', action='store_const', const='lldb --', dest='vm_prefix', help='alias for --vmprefix "lldb --"') + + mx.update_commands(suite, commands) + +def mx_post_parse_cmd_line(opts): # + # TODO _minVersion check could probably be part of a Suite in mx? + def _versionCheck(version): + return version >= _minVersion and (not _untilVersion or version >= _untilVersion) + versionDesc = ">=" + str(_minVersion) + if _untilVersion: + versionDesc += " and <=" + str(_untilVersion) + mx.java(_versionCheck, versionDescription=versionDesc, defaultJdk=True) + + if hasattr(opts, 'vm') and opts.vm is not None: + global _vm + _vm = opts.vm + _vm = _vm.replace('graal', 'jvmci') + if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: + global _vmbuild + _vmbuild = opts.vmbuild + global _make_eclipse_launch + _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) + global _jacoco + _jacoco = opts.jacoco + global _vm_cwd + _vm_cwd = opts.vm_cwd + global _installed_jdks + _installed_jdks = opts.installed_jdks + global _vm_prefix + _vm_prefix = opts.vm_prefix + + for jdkDist in _jdkDeployedDists: + def _close(jdkDeployable): + def _install(dist): + assert dist.name == jdkDeployable.name, dist.name + "!=" + jdkDeployable.name + if not jdkDist.partOfHotSpot: + _installDistInJdks(jdkDeployable) + return _install + mx.distribution(jdkDist.name).add_update_listener(_close(jdkDist))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mx.graal/mx_graal_makefile.py Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,309 @@ +# +# ---------------------------------------------------------------------------------------------------- +# +# Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# ---------------------------------------------------------------------------------------------------- +# +import mx, mx_graal, os +from argparse import ArgumentParser, REMAINDER + + +class Makefile: + def __init__(self): + self.rules = [] + self.definitions = [] + + def add_rule(self, s): + self.rules.append(s) + + def add_definition(self, s): + self.definitions.append(s) + + def generate(self): + return "\n\n".join(self.definitions + self.rules) + + +def build_makefile(args): + """Creates a Makefile which is able to build distributions without mx + + The return value indicates how many files were modified""" + parser = ArgumentParser(prog='mx makefile') + parser.add_argument('-o', action='store', dest='output', help='Write contents to this file.') + parser.add_argument('selectedDists', help="Selected distribution names which are going to be built with make.", nargs=REMAINDER) + opts = parser.parse_args(args) + + if opts.selectedDists == None or len(opts.selectedDists) == 0: + opts.selectedDists = [d.name for d in mx_graal._jdkDeployedDists if d.partOfHotSpot] + mf = Makefile() + commandline = " ".join(["mx.sh", "makefile"] + args) + if do_build_makefile(mf, opts.selectedDists, commandline): + contents = mf.generate() + if opts.output == None: + print contents + else: + if mx.update_file(opts.output, contents, showDiff=True): + return 1 + return 0 + +def short_dist_name(name): + return name.replace("COM_ORACLE_", "") + +def filter_projects(deps, t): + def typeFilter(project): # filters + if isinstance(project, str): + project = mx.dependency(project, True) + return isinstance(project, t) + return [d for d in deps if typeFilter(d)] + +def get_jdk_deployed_dists(): + return [d.name for d in mx_graal._jdkDeployedDists] + +def update_list(li, elements): + for e in elements: + if e not in li: + li.append(e) + +def make_dist_rule(dist, mf): + def path_dist_relative(p): + return os.path.relpath(p, dist.suite.dir) + shortName = short_dist_name(dist.name) + jdkDeployedDists = get_jdk_deployed_dists() + jarPath = path_dist_relative(dist.path) + sourcesVariableName = shortName + "_SRC" + depJarVariableName = shortName + "_DEP_JARS" + sources = [] + resources = [] + sortedDeps = dist.sorted_deps(True, transitive=False, includeAnnotationProcessors=True) + projects = filter_projects(sortedDeps, mx.Project) + targetPathPrefix = "$(TARGET)" + os.path.sep + libraryDeps = [path_dist_relative(l.get_path(False)) for l in filter_projects(sortedDeps, mx.Library)] + + annotationProcessorDeps = [] + distDeps = dist.get_dist_deps(includeSelf=False, transitive=True) + distDepProjects = [] + for d in distDeps: + update_list(distDepProjects, d.sorted_deps(includeLibs=False, transitive=True)) + + classPath = [targetPathPrefix + path_dist_relative(d.path) for d in distDeps] + libraryDeps \ + + [path_dist_relative(mx.dependency(name).path) for name in dist.excludedDependencies] + for p in projects: + if p.definedAnnotationProcessors != None and p.definedAnnotationProcessorsDist != dist: + update_list(annotationProcessorDeps, [p]) + for p in projects: + projectDir = path_dist_relative(p.dir) + if p not in distDepProjects and p not in annotationProcessorDeps: + for src in [projectDir + os.path.sep + d for d in p.srcDirs]: + sources.append("$(shell find {} -type f 2> /dev/null)".format(src)) + metaInf = src + os.path.sep + "META-INF" + if os.path.exists(metaInf): + resources.append(metaInf) + + + sourceLines = sourcesVariableName + " = " + ("\n" + sourcesVariableName + " += ").join(sources) + apPaths = [] + apDistNames = [] + apDistVariableNames = [] + for p in annotationProcessorDeps: + apPaths.append(path_dist_relative(p.definedAnnotationProcessorsDist.path)) + name = short_dist_name(p.definedAnnotationProcessorsDist.name) + apDistNames.append(name) + apDistVariableNames.append("$(" + name + "_JAR)") + shouldExport = dist.name in jdkDeployedDists + props = { + "name": shortName, + "jarPath": targetPathPrefix + jarPath, + "depJarsVariableAccess": "$(" + depJarVariableName + ")" if len(classPath) > 0 else "", + "depJarsVariable": depJarVariableName, + "sourceLines": sourceLines, + "sourcesVariableName": sourcesVariableName, + "annotationProcessors": " ".join(apDistVariableNames), + "cpAnnotationProcessors": ":".join(apDistVariableNames), + "jarDeps": " ".join(classPath), + "copyResources": " ".join(resources) + } + + mf.add_definition(sourceLines) + mf.add_definition("{name}_JAR = {jarPath}".format(**props)) + if len(classPath) > 0: mf.add_definition("{depJarsVariable} = {jarDeps}".format(**props)) + if shouldExport: mf.add_definition("EXPORTED_FILES += $({name}_JAR)".format(**props)) + mf.add_rule("""$({name}_JAR): $({sourcesVariableName}) {annotationProcessors} {depJarsVariableAccess} +\t$(call build_and_jar,{cpAnnotationProcessors},$(subst $(space),:,{depJarsVariableAccess}),{copyResources},$({name}_JAR)) +""".format(**props)) + return + + + +def do_build_makefile(mf, selectedDists, commandline): + java = mx.java() + bootClassPath = java.bootclasspath() + bootClassPath = bootClassPath.replace(os.path.realpath(java.jdk), "$(ABS_BOOTDIR)") + jdkBootClassPathVariableName = "JDK_BOOTCLASSPATH" + + mf.add_definition("""# This Makefile is generated automatically, do not edit + +TARGET=. +# Bootstrap JDK to be used (for javac and jar) +ABS_BOOTDIR= + +JAVAC=$(ABS_BOOTDIR)/bin/javac -g -target """ + str(java.javaCompliance) + """ +JAR=$(ABS_BOOTDIR)/bin/jar + +HS_COMMON_SRC=. + +# Directories, where the generated property-files reside within the JAR files +PROVIDERS_INF=/META-INF/jvmci.providers +SERVICES_INF=/META-INF/jvmci.services +OPTIONS_INF=/META-INF/jvmci.options + +JARS = $(foreach dist,$(DISTRIBUTIONS),$($(dist)_JAR)) + +ifeq ($(ABS_BOOTDIR),) + $(error Variable ABS_BOOTDIR must be set to a JDK installation.) +endif +ifeq ($(MAKE_VERBOSE),) + QUIETLY=@ +endif + +# Required to construct a whitespace for use with subst +space := +space += + +# Takes the provider files created by ServiceProviderProcessor (the processor +# for the @ServiceProvider annotation) and merges them into a single file. +# Arguments: +# 1: directory with contents of the JAR file +define process_providers + $(eval providers := $(1)/$(PROVIDERS_INF)) + $(eval services := $(1)/$(SERVICES_INF)) + $(QUIETLY) test -d $(services) || mkdir -p $(services) + $(QUIETLY) test ! -d $(providers) || (cd $(providers) && for i in $$(ls); do c=$$(cat $$i); echo $$i >> $(abspath $(services))/$$c; rm $$i; done) + + @# Since all projects are built together with one javac call we cannot determine + @# which project contains HotSpotVMConfig.inline.hpp so we hardcode it. + $(eval vmconfig := $(1)/hotspot/HotSpotVMConfig.inline.hpp) + $(eval vmconfigDest := $(HS_COMMON_SRC)/../jvmci/com.oracle.jvmci.hotspot/src_gen/hotspot) + $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) +endef + +# Reads the files in jvmci.options/ created by OptionProcessor (the processor for the @Option annotation) +# and appends to services/com.oracle.jvmci.options.Options entries for the providers +# also created by the same processor. +# Arguments: +# 1: directory with contents of the JAR file +define process_options + $(eval options := $(1)/$(OPTIONS_INF)) + $(eval services := $(1)/META-INF/services) + $(QUIETLY) test -d $(services) || mkdir -p $(services) + $(QUIETLY) test ! -d $(options) || (cd $(options) && for i in $$(ls); do echo $${i}_Options >> $(abspath $(services))/com.oracle.jvmci.options.Options; done) +endef + +# Extracts META-INF/jvmci.services and META-INF/jvmci.options of a JAR file into a given directory +# Arguments: +# 1: JAR file to extract +# 2: target directory (which already exists) +define extract + $(eval TMP := $(shell mktemp -d $(TARGET)/tmp_XXXXX)) + $(QUIETLY) cd $(TMP) && $(JAR) xf $(abspath $(1)) && \\ + ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && \\ + (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))); + $(QUIETLY) rm -r $(TMP); + $(QUIETLY) cp $(1) $(2) +endef + +# Calls $(JAVAC) with the boot class path $(JDK_BOOTCLASSPATH) and sources taken from the automatic variable $^ +# Arguments: +# 1: processorpath +# 2: classpath +# 3: resources to copy +# 4: target JAR file +define build_and_jar + $(info Building $(4)) + $(eval TMP := $(shell mkdir -p $(TARGET) && mktemp -d $(TARGET)/tmp_XXXXX)) + $(QUIETLY) $(JAVAC) -d $(TMP) -processorpath :$(1) -bootclasspath $(JDK_BOOTCLASSPATH) -cp :$(2) $(filter %.java,$^) + $(QUIETLY) test "$(3)" = "" || cp -r $(3) $(TMP) + $(QUIETLY) $(call process_options,$(TMP)) + $(QUIETLY) $(call process_providers,$(TMP)) + $(QUIETLY) mkdir -p $(shell dirname $(4)) + $(QUIETLY) $(JAR) -0cf $(4) -C $(TMP) . + $(QUIETLY) rm -r $(TMP) +endef + +# Verifies that make/defs.make contains an appropriate line for each JVMCI service or option +# and that only existing JVMCI services and options are exported. +# Arguments: +# 1: list of service or option files +# 2: variable name for directory of service or option files +define verify_defs_make + $(eval defs := make/defs.make) + $(eval uncondPattern := EXPORT_LIST += $$$$($(2))/) + $(eval condPattern := CONDITIONAL_EXPORT_LIST += $$$$($(2))/) + $(eval unconditionalExports := $(shell grep '^EXPORT_LIST += $$($2)' make/defs.make | sed 's:.*($(2))/::g')) + $(eval conditionalExports := $(shell grep '^CONDITIONAL_EXPORT_LIST += $$($2)' make/defs.make | sed 's:.*($(2))/::g')) + $(eval allExports := $(unconditionalExports) $(conditionalExports)) + $(foreach file,$(1),$(if $(findstring $(file),$(allExports)), ,$(error "Line matching '$(uncondPattern)$(file)' or '$(condPattern)$(file)' not found in $(defs)"))) + $(foreach export,$(unconditionalExports),$(if $(findstring $(export),$(1)), ,$(error "The line '$(uncondPattern)$(export)' should not be in $(defs)"))) +endef + +all: default +\t$(info Put $(EXPORTED_FILES) into SHARED_DIR $(SHARED_DIR)) +\t$(shell mkdir -p $(SHARED_DIR)) +\t$(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(SHARED_DIR))) + +export: all +\t$(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.services/*)),EXPORT_JRE_LIB_JVMCI_SERVICES_DIR) +\t$(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.options/*)),EXPORT_JRE_LIB_JVMCI_OPTIONS_DIR) +.PHONY: export + +clean: +\t$(QUIETLY) rm $(JARS) 2> /dev/null || true +\t$(QUIETLY) rmdir -p $(dir $(JARS)) 2> /dev/null || true +.PHONY: export clean + +""") + s = mx.suite("graal") + dists = [] + ap = [] + projects = [] + for d in s.dists: + if d.name in selectedDists: + update_list(dists, d.get_dist_deps(True, True)) + update_list(projects, d.sorted_deps(includeLibs=False, transitive=True)) + + for p in projects: + deps = p.all_deps([], False, includeSelf=True, includeJreLibs=False, includeAnnotationProcessors=True) + for d in deps: + if d.definedAnnotationProcessorsDist != None: + apd = d.definedAnnotationProcessorsDist + update_list(ap, [apd]) + + if len(dists) > 0: + mf.add_definition(jdkBootClassPathVariableName + " = " + bootClassPath) + for d in ap: make_dist_rule(d, mf) + for d in dists: make_dist_rule(d, mf) + mf.add_definition("DISTRIBUTIONS = " + " ".join([short_dist_name(d.name) for d in dists+ap])) + mf.add_rule("default: $({}_JAR)\n.PHONY: default\n".format("_JAR) $(".join([short_dist_name(d.name) for d in dists]))) + return True + else: + for d in dists: + selectedDists.remove(d.name) + print "Distribution(s) '" + "', '".join(selectedDists) + "' does not exist."
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mx.graal/outputparser.py Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,71 @@ +# ---------------------------------------------------------------------------------------------------- +# +# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# ---------------------------------------------------------------------------------------------------- + +import re + +class OutputParser: + + def __init__(self): + self.matchers = [] + + def addMatcher(self, matcher): + self.matchers.append(matcher) + + def parse(self, output): + valueMaps = [] + for matcher in self.matchers: + matcher.parse(output, valueMaps) + return valueMaps + +""" +Produces a value map for each match of a given regular expression +in some text. The value map is specified by a template map +where each key and value in the template map is either a constant +value or a named group in the regular expression. The latter is +given as the group name enclosed in '<' and '>'. +""" +class ValuesMatcher: + + def __init__(self, regex, valuesTemplate): + assert isinstance(valuesTemplate, dict) + self.regex = regex + self.valuesTemplate = valuesTemplate + + def parse(self, text, valueMaps): + for match in self.regex.finditer(text): + valueMap = {} + for keyTemplate, valueTemplate in self.valuesTemplate.items(): + key = self.get_template_value(match, keyTemplate) + value = self.get_template_value(match, valueTemplate) + assert not valueMap.has_key(key), key + valueMap[key] = value + valueMaps.append(valueMap) + + def get_template_value(self, match, template): + def replace_var(m): + groupName = m.group(1) + return match.group(groupName) + + return re.sub(r'<([\w]+)>', replace_var, template)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mx.graal/sanitycheck.py Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,435 @@ +# ---------------------------------------------------------------------------------------------------- +# +# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# ---------------------------------------------------------------------------------------------------- + +from outputparser import OutputParser, ValuesMatcher +import re, mx, mx_graal, os, sys, StringIO, subprocess +from os.path import isfile, join, exists + +gc = 'UseSerialGC' + +dacapoSanityWarmup = { + 'avrora': [0, 0, 3, 6, 13], + 'batik': [0, 0, 5, 5, 20], + 'eclipse': [0, 0, 0, 0, 0], + 'fop': [4, 8, 10, 20, 30], + 'h2': [0, 0, 5, 5, 8], + 'jython': [0, 0, 5, 10, 13], + 'luindex': [0, 0, 5, 10, 10], + 'lusearch': [0, 4, 5, 5, 8], + 'pmd': [0, 0, 5, 10, 13], + 'sunflow': [0, 2, 5, 10, 15], + 'tomcat': [0, 0, 5, 10, 15], + 'tradebeans': [0, 0, 5, 10, 13], + 'tradesoap': [0, 0, 5, 10, 15], + 'xalan': [0, 0, 5, 10, 18], +} + +dacapoScalaSanityWarmup = { + 'actors': [0, 0, 2, 5, 5], + 'apparat': [0, 0, 2, 5, 5], + 'factorie': [0, 0, 2, 5, 5], + 'kiama': [0, 4, 3, 13, 15], + 'scalac': [0, 0, 5, 15, 20], + 'scaladoc': [0, 0, 5, 15, 15], + 'scalap': [0, 0, 5, 15, 20], + 'scalariform':[0, 0, 6, 15, 20], + 'scalatest': [0, 0, 2, 10, 12], + 'scalaxb': [0, 0, 5, 15, 25], +# (gdub) specs sometimes returns a non-zero value event though there is no apparent failure + 'specs': [0, 0, 0, 0, 0], + 'tmt': [0, 0, 3, 10, 12] +} + +dacapoGateBuildLevels = { + 'avrora': ['product', 'fastdebug', 'debug'], + 'batik': ['product', 'fastdebug', 'debug'], + # (lewurm): does not work with JDK8 + 'eclipse': [], + 'fop': ['fastdebug', 'debug'], + 'h2': ['product', 'fastdebug', 'debug'], + 'jython': ['product', 'fastdebug', 'debug'], + 'luindex': ['product', 'fastdebug', 'debug'], + 'lusearch': ['product'], + 'pmd': ['product', 'fastdebug', 'debug'], + 'sunflow': ['fastdebug', 'debug'], + 'tomcat': ['product', 'fastdebug', 'debug'], + 'tradebeans': ['product', 'fastdebug', 'debug'], + # tradesoap is too unreliable for the gate, often crashing with concurrency problems: + # http://sourceforge.net/p/dacapobench/bugs/99/ + 'tradesoap': [], + 'xalan': ['product', 'fastdebug', 'debug'], +} + +dacapoScalaGateBuildLevels = { + 'actors': ['product', 'fastdebug', 'debug'], + 'apparat': ['product', 'fastdebug', 'debug'], + 'factorie': ['product', 'fastdebug', 'debug'], + 'kiama': ['fastdebug', 'debug'], + 'scalac': ['product', 'fastdebug', 'debug'], + 'scaladoc': ['product', 'fastdebug', 'debug'], + 'scalap': ['product', 'fastdebug', 'debug'], + 'scalariform':['product', 'fastdebug', 'debug'], + 'scalatest': ['product', 'fastdebug', 'debug'], + 'scalaxb': ['product', 'fastdebug', 'debug'], + 'specs': ['product', 'fastdebug', 'debug'], + 'tmt': ['product', 'fastdebug', 'debug'], +} + +specjvm2008Names = [ + 'startup.helloworld', + 'startup.compiler.compiler', + 'startup.compiler.sunflow', + 'startup.compress', + 'startup.crypto.aes', + 'startup.crypto.rsa', + 'startup.crypto.signverify', + 'startup.mpegaudio', + 'startup.scimark.fft', + 'startup.scimark.lu', + 'startup.scimark.monte_carlo', + 'startup.scimark.sor', + 'startup.scimark.sparse', + 'startup.serial', + 'startup.sunflow', + 'startup.xml.transform', + 'startup.xml.validation', + 'compiler.compiler', + 'compiler.sunflow', + 'compress', + 'crypto.aes', + 'crypto.rsa', + 'crypto.signverify', + 'derby', + 'mpegaudio', + 'scimark.fft.large', + 'scimark.lu.large', + 'scimark.sor.large', + 'scimark.sparse.large', + 'scimark.fft.small', + 'scimark.lu.small', + 'scimark.sor.small', + 'scimark.sparse.small', + 'scimark.monte_carlo', + 'serial', + 'sunflow', + 'xml.transform', + 'xml.validation' +] + +def _noneAsEmptyList(a): + if a is None: + return [] + return a + +class SanityCheckLevel: + Fast, Gate, Normal, Extensive, Benchmark = range(5) + +def getSPECjbb2005(benchArgs=None): + benchArgs = [] if benchArgs is None else benchArgs + + specjbb2005 = mx.get_env('SPECJBB2005') + if specjbb2005 is None or not exists(join(specjbb2005, 'jbb.jar')): + mx.abort('Please set the SPECJBB2005 environment variable to a SPECjbb2005 directory') + + score = re.compile(r"^Valid run, Score is (?P<score>[0-9]+)$", re.MULTILINE) + error = re.compile(r"VALIDATION ERROR") + success = re.compile(r"^Valid run, Score is [0-9]+$", re.MULTILINE) + matcher = ValuesMatcher(score, {'group' : 'SPECjbb2005', 'name' : 'score', 'score' : '<score>'}) + classpath = ['jbb.jar', 'check.jar'] + return Test("SPECjbb2005", ['spec.jbb.JBBmain', '-propfile', 'SPECjbb.props'] + benchArgs, [success], [error], [matcher], vmOpts=['-Xms3g', '-XX:+' + gc, '-XX:-UseCompressedOops', '-cp', os.pathsep.join(classpath)], defaultCwd=specjbb2005) + +def getSPECjbb2013(benchArgs=None): + + specjbb2013 = mx.get_env('SPECJBB2013') + if specjbb2013 is None or not exists(join(specjbb2013, 'specjbb2013.jar')): + mx.abort('Please set the SPECJBB2013 environment variable to a SPECjbb2013 directory') + + jops = re.compile(r"^RUN RESULT: hbIR \(max attempted\) = [0-9]+, hbIR \(settled\) = [0-9]+, max-jOPS = (?P<max>[0-9]+), critical-jOPS = (?P<critical>[0-9]+)$", re.MULTILINE) + # error? + success = re.compile(r"org.spec.jbb.controller: Run finished", re.MULTILINE) + matcherMax = ValuesMatcher(jops, {'group' : 'SPECjbb2013', 'name' : 'max', 'score' : '<max>'}) + matcherCritical = ValuesMatcher(jops, {'group' : 'SPECjbb2013', 'name' : 'critical', 'score' : '<critical>'}) + return Test("SPECjbb2013", ['-jar', 'specjbb2013.jar', '-m', 'composite'] + + _noneAsEmptyList(benchArgs), [success], [], [matcherCritical, matcherMax], + vmOpts=['-Xmx6g', '-Xms6g', '-Xmn3g', '-XX:+UseParallelOldGC', '-XX:-UseAdaptiveSizePolicy', '-XX:-UseBiasedLocking', '-XX:-UseCompressedOops'], defaultCwd=specjbb2013) + +def getSPECjvm2008(benchArgs=None): + + specjvm2008 = mx.get_env('SPECJVM2008') + if specjvm2008 is None or not exists(join(specjvm2008, 'SPECjvm2008.jar')): + mx.abort('Please set the SPECJVM2008 environment variable to a SPECjvm2008 directory') + + score = re.compile(r"^(Score on|Noncompliant) (?P<benchmark>[a-zA-Z0-9\._]+)( result)?: (?P<score>[0-9]+((,|\.)[0-9]+)?)( SPECjvm2008 Base)? ops/m$", re.MULTILINE) + error = re.compile(r"^Errors in benchmark: ", re.MULTILINE) + # The ' ops/m' at the end of the success string is important : it's how you can tell valid and invalid runs apart + success = re.compile(r"^(Noncompliant c|C)omposite result: [0-9]+((,|\.)[0-9]+)?( SPECjvm2008 (Base|Peak))? ops/m$", re.MULTILINE) + matcher = ValuesMatcher(score, {'group' : 'SPECjvm2008', 'name' : '<benchmark>', 'score' : '<score>'}) + + return Test("SPECjvm2008", ['-jar', 'SPECjvm2008.jar'] + _noneAsEmptyList(benchArgs), [success], [error], [matcher], vmOpts=['-Xms3g', '-XX:+' + gc, '-XX:-UseCompressedOops'], defaultCwd=specjvm2008) + +def getDacapos(level=SanityCheckLevel.Normal, gateBuildLevel=None, dacapoArgs=None): + checks = [] + + for (bench, ns) in dacapoSanityWarmup.items(): + if ns[level] > 0: + if gateBuildLevel is None or gateBuildLevel in dacapoGateBuildLevels[bench]: + checks.append(getDacapo(bench, ['-n', str(ns[level])] + _noneAsEmptyList(dacapoArgs))) + + return checks + +def getDacapo(name, dacapoArgs=None): + dacapo = mx.get_env('DACAPO_CP') + if dacapo is None: + l = mx.library('DACAPO', False) + if l is not None: + dacapo = l.get_path(True) + else: + mx.abort('DaCapo 9.12 jar file must be specified with DACAPO_CP environment variable or as DACAPO library') + + if not isfile(dacapo) or not dacapo.endswith('.jar'): + mx.abort('Specified DaCapo jar file does not exist or is not a jar file: ' + dacapo) + + dacapoSuccess = re.compile(r"^===== DaCapo 9\.12 ([a-zA-Z0-9_]+) PASSED in ([0-9]+) msec =====", re.MULTILINE) + dacapoFail = re.compile(r"^===== DaCapo 9\.12 ([a-zA-Z0-9_]+) FAILED (warmup|) =====", re.MULTILINE) + dacapoTime = re.compile(r"===== DaCapo 9\.12 (?P<benchmark>[a-zA-Z0-9_]+) PASSED in (?P<time>[0-9]+) msec =====") + dacapoTime1 = re.compile(r"===== DaCapo 9\.12 (?P<benchmark>[a-zA-Z0-9_]+) completed warmup 1 in (?P<time>[0-9]+) msec =====") + + dacapoMatcher = ValuesMatcher(dacapoTime, {'group' : 'DaCapo', 'name' : '<benchmark>', 'score' : '<time>'}) + dacapoMatcher1 = ValuesMatcher(dacapoTime1, {'group' : 'DaCapo-1stRun', 'name' : '<benchmark>', 'score' : '<time>'}) + + # Use ipv4 stack for dacapos; tomcat+solaris+ipv6_interface fails (see also: JDK-8072384) + return Test("DaCapo-" + name, ['-jar', mx._cygpathU2W(dacapo), name] + _noneAsEmptyList(dacapoArgs), [dacapoSuccess], [dacapoFail], [dacapoMatcher, dacapoMatcher1], ['-Xms2g', '-XX:+' + gc, '-XX:-UseCompressedOops', "-Djava.net.preferIPv4Stack=true"]) + +def getScalaDacapos(level=SanityCheckLevel.Normal, gateBuildLevel=None, dacapoArgs=None): + checks = [] + + for (bench, ns) in dacapoScalaSanityWarmup.items(): + if ns[level] > 0: + if gateBuildLevel is None or gateBuildLevel in dacapoScalaGateBuildLevels[bench]: + checks.append(getScalaDacapo(bench, ['-n', str(ns[level])] + _noneAsEmptyList(dacapoArgs))) + + return checks + +def getScalaDacapo(name, dacapoArgs=None): + dacapo = mx.get_env('DACAPO_SCALA_CP') + if dacapo is None: + l = mx.library('DACAPO_SCALA', False) + if l is not None: + dacapo = l.get_path(True) + else: + mx.abort('Scala DaCapo 0.1.0 jar file must be specified with DACAPO_SCALA_CP environment variable or as DACAPO_SCALA library') + + if not isfile(dacapo) or not dacapo.endswith('.jar'): + mx.abort('Specified Scala DaCapo jar file does not exist or is not a jar file: ' + dacapo) + + dacapoSuccess = re.compile(r"^===== DaCapo 0\.1\.0(-SNAPSHOT)? ([a-zA-Z0-9_]+) PASSED in ([0-9]+) msec =====", re.MULTILINE) + dacapoFail = re.compile(r"^===== DaCapo 0\.1\.0(-SNAPSHOT)? ([a-zA-Z0-9_]+) FAILED (warmup|) =====", re.MULTILINE) + dacapoTime = re.compile(r"===== DaCapo 0\.1\.0(-SNAPSHOT)? (?P<benchmark>[a-zA-Z0-9_]+) PASSED in (?P<time>[0-9]+) msec =====") + + dacapoMatcher = ValuesMatcher(dacapoTime, {'group' : "Scala-DaCapo", 'name' : '<benchmark>', 'score' : '<time>'}) + + return Test("Scala-DaCapo-" + name, ['-jar', mx._cygpathU2W(dacapo), name] + _noneAsEmptyList(dacapoArgs), [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:+' + gc, '-XX:-UseCompressedOops']) + +def getBootstraps(): + time = re.compile(r"Bootstrapping Graal\.+ in (?P<time>[0-9]+) ms( \(compiled (?P<methods>[0-9]+) methods\))?") + scoreMatcher = ValuesMatcher(time, {'group' : 'Bootstrap', 'name' : 'BootstrapTime', 'score' : '<time>'}) + methodMatcher = ValuesMatcher(time, {'group' : 'Bootstrap', 'name' : 'BootstrapMethods', 'score' : '<methods>'}) + scoreMatcherBig = ValuesMatcher(time, {'group' : 'Bootstrap-bigHeap', 'name' : 'BootstrapTime', 'score' : '<time>'}) + methodMatcherBig = ValuesMatcher(time, {'group' : 'Bootstrap-bigHeap', 'name' : 'BootstrapMethods', 'score' : '<methods>'}) + + tests = [] + tests.append(Test("Bootstrap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcher, methodMatcher], ignoredVMs=['client', 'server'], benchmarkCompilationRate=False)) + tests.append(Test("Bootstrap-bigHeap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcherBig, methodMatcherBig], vmOpts=['-Xms2g'], ignoredVMs=['client', 'server'], benchmarkCompilationRate=False)) + return tests + +class CTWMode: + Full, NoInline = range(2) + +def getCTW(vm, mode): + time = re.compile(r"CompileTheWorld : Done \([0-9]+ classes, [0-9]+ methods, (?P<time>[0-9]+) ms\)") + scoreMatcher = ValuesMatcher(time, {'group' : 'CompileTheWorld', 'name' : 'CompileTime', 'score' : '<time>'}) + + jre = os.environ.get('JAVA_HOME') + if exists(join(jre, 'jre')): + jre = join(jre, 'jre') + rtjar = join(jre, 'lib', 'rt.jar') + + + args = ['-XX:+CompileTheWorld', '-Xbootclasspath/p:' + rtjar] + if vm == 'jvmci': + args += ['-XX:+BootstrapGraal'] + if mode >= CTWMode.NoInline: + if not mx_graal.isJVMCIEnabled(vm): + args.append('-XX:-Inline') + else: + args.append('-G:CompileTheWordConfig=-Inline') + + return Test("CompileTheWorld", args, successREs=[time], scoreMatchers=[scoreMatcher], benchmarkCompilationRate=False) + + +class Tee: + def __init__(self): + self.output = StringIO.StringIO() + def eat(self, line): + self.output.write(line) + sys.stdout.write(line) + +""" +Encapsulates a single program that is a sanity test and/or a benchmark. +""" +class Test: + def __init__(self, name, cmd, successREs=None, failureREs=None, scoreMatchers=None, vmOpts=None, defaultCwd=None, ignoredVMs=None, benchmarkCompilationRate=False): + + self.name = name + self.successREs = _noneAsEmptyList(successREs) + self.failureREs = _noneAsEmptyList(failureREs) + [re.compile(r"Exception occurred in scope: ")] + self.scoreMatchers = _noneAsEmptyList(scoreMatchers) + self.vmOpts = _noneAsEmptyList(vmOpts) + self.cmd = cmd + self.defaultCwd = defaultCwd + self.ignoredVMs = _noneAsEmptyList(ignoredVMs) + self.benchmarkCompilationRate = benchmarkCompilationRate + if benchmarkCompilationRate: + self.vmOpts = self.vmOpts + ['-XX:+CITime'] + + def __str__(self): + return self.name + + def test(self, vm, cwd=None, extraVmOpts=None, vmbuild=None): + """ + Run this program as a sanity test. + """ + if vm in self.ignoredVMs: + return True + if cwd is None: + cwd = self.defaultCwd + parser = OutputParser() + jvmError = re.compile(r"(?P<jvmerror>([A-Z]:|/).*[/\\]hs_err_pid[0-9]+\.log)") + parser.addMatcher(ValuesMatcher(jvmError, {'jvmError' : '<jvmerror>'})) + + for successRE in self.successREs: + parser.addMatcher(ValuesMatcher(successRE, {'passed' : '1'})) + for failureRE in self.failureREs: + parser.addMatcher(ValuesMatcher(failureRE, {'failed' : '1'})) + + tee = Tee() + retcode = mx_graal.vm(self.vmOpts + _noneAsEmptyList(extraVmOpts) + self.cmd, vm, nonZeroIsFatal=False, out=tee.eat, err=subprocess.STDOUT, cwd=cwd, vmbuild=vmbuild) + output = tee.output.getvalue() + valueMaps = parser.parse(output) + + if len(valueMaps) == 0: + return False + + record = {} + for valueMap in valueMaps: + for key, value in valueMap.items(): + if record.has_key(key) and record[key] != value: + mx.abort('Inconsistant values returned by test machers : ' + str(valueMaps)) + record[key] = value + + jvmErrorFile = record.get('jvmError') + if jvmErrorFile: + mx.log('/!\\JVM Error : dumping error log...') + with open(jvmErrorFile, 'rb') as fp: + mx.log(fp.read()) + os.unlink(jvmErrorFile) + return False + + if record.get('failed') == '1': + return False + + return retcode == 0 and record.get('passed') == '1' + + def bench(self, vm, cwd=None, extraVmOpts=None, vmbuild=None): + """ + Run this program as a benchmark. + """ + if vm in self.ignoredVMs: + return {} + if cwd is None: + cwd = self.defaultCwd + parser = OutputParser() + + for successRE in self.successREs: + parser.addMatcher(ValuesMatcher(successRE, {'passed' : '1'})) + for failureRE in self.failureREs: + parser.addMatcher(ValuesMatcher(failureRE, {'failed' : '1'})) + for scoreMatcher in self.scoreMatchers: + parser.addMatcher(scoreMatcher) + + if self.benchmarkCompilationRate: + if vm == 'jvmci': + bps = re.compile(r"ParsedBytecodesPerSecond@final: (?P<rate>[0-9]+)") + ibps = re.compile(r"InlinedBytecodesPerSecond@final: (?P<rate>[0-9]+)") + parser.addMatcher(ValuesMatcher(bps, {'group' : 'ParsedBytecodesPerSecond', 'name' : self.name, 'score' : '<rate>'})) + parser.addMatcher(ValuesMatcher(ibps, {'group' : 'InlinedBytecodesPerSecond', 'name' : self.name, 'score' : '<rate>'})) + else: + ibps = re.compile(r"(?P<compiler>[\w]+) compilation speed: +(?P<rate>[0-9]+) bytes/s {standard") + parser.addMatcher(ValuesMatcher(ibps, {'group' : 'InlinedBytecodesPerSecond', 'name' : '<compiler>:' + self.name, 'score' : '<rate>'})) + + startDelim = 'START: ' + self.name + endDelim = 'END: ' + self.name + + outputfile = os.environ.get('BENCH_OUTPUT', None) + if outputfile: + # Used only to debug output parsing + with open(outputfile) as fp: + output = fp.read() + start = output.find(startDelim) + end = output.find(endDelim, start) + if start == -1 and end == -1: + return {} + output = output[start + len(startDelim + os.linesep): end] + mx.log(startDelim) + mx.log(output) + mx.log(endDelim) + else: + tee = Tee() + mx.log(startDelim) + if mx_graal.vm(self.vmOpts + _noneAsEmptyList(extraVmOpts) + self.cmd, vm, nonZeroIsFatal=False, out=tee.eat, err=subprocess.STDOUT, cwd=cwd, vmbuild=vmbuild) != 0: + mx.abort("Benchmark failed (non-zero retcode)") + mx.log(endDelim) + output = tee.output.getvalue() + + groups = {} + passed = False + for valueMap in parser.parse(output): + assert (valueMap.has_key('name') and valueMap.has_key('score') and valueMap.has_key('group')) or valueMap.has_key('passed') or valueMap.has_key('failed'), valueMap + if valueMap.get('failed') == '1': + mx.abort("Benchmark failed") + if valueMap.get('passed') == '1': + passed = True + groupName = valueMap.get('group') + if groupName: + group = groups.setdefault(groupName, {}) + name = valueMap.get('name') + score = valueMap.get('score') + if name and score: + group[name] = score + + if not passed: + mx.abort("Benchmark failed (not passed)") + + return groups
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mx.graal/suite.py Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,1273 @@ +suite = { + "mxversion" : "1.0", + "name" : "graal", + "libraries" : { + + # ------------- Libraries ------------- + + "JLINE" : { + "path" : "lib/jline-2.11.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/jline-2.11.jar", + "https://search.maven.org/remotecontent?filepath=jline/jline/2.11/jline-2.11.jar", + ], + "sha1" : "9504d5e2da5d78237239c5226e8200ec21182040", + }, + + "JUNIT" : { + "path" : "lib/junit-4.11.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/junit-4.11.jar", + "https://search.maven.org/remotecontent?filepath=junit/junit/4.11/junit-4.11.jar", + ], + "sha1" : "4e031bb61df09069aeb2bffb4019e7a5034a4ee0", + "eclipse.container" : "org.eclipse.jdt.junit.JUNIT_CONTAINER/4", + "sourcePath" : "lib/junit-4.11-sources.jar", + "sourceUrls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/junit-4.11-sources.jar", + "https://search.maven.org/remotecontent?filepath=junit/junit/4.11/junit-4.11-sources.jar", + ], + "sourceSha1" : "28e0ad201304e4a4abf999ca0570b7cffc352c3c", + "dependencies" : ["HAMCREST"], + }, + + "CHECKSTYLE" : { + "path" : "lib/checkstyle-6.0-all.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/checkstyle-6.0-all.jar", + "jar:http://sourceforge.net/projects/checkstyle/files/checkstyle/6.0/checkstyle-6.0-bin.zip/download!/checkstyle-6.0/checkstyle-6.0-all.jar", + ], + "sha1" : "2bedc7feded58b5fd65595323bfaf7b9bb6a3c7a", + }, + + "HAMCREST" : { + "path" : "lib/hamcrest-core-1.3.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/hamcrest-core-1.3.jar", + "https://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar", + ], + "sha1" : "42a25dc3219429f0e5d060061f71acb49bf010a0", + "sourcePath" : "lib/hamcrest-core-1.3-sources.jar", + "sourceUrls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/hamcrest-core-1.3-sources.jar", + "https://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar", + ], + "sourceSha1" : "1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b", + }, + + "HCFDIS" : { + "path" : "lib/hcfdis-2.jar", + "urls" : ["http://lafo.ssw.uni-linz.ac.at/hcfdis-2.jar"], + "sha1" : "bc8b2253436485e9dbaf81771c259ccfa1a24c80", + }, + + "FINDBUGS_DIST" : { + "path" : "lib/findbugs-dist-3.0.0.zip", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/findbugs-3.0.0.zip", + "http://sourceforge.net/projects/findbugs/files/findbugs/3.0.0/findbugs-3.0.0.zip/download", + ], + "sha1" : "6e56d67f238dbcd60acb88a81655749aa6419c5b", + }, + + "C1VISUALIZER_DIST" : { + "path" : "lib/c1visualizer_2014-04-22.zip", + "urls" : ["https://java.net/downloads/c1visualizer/c1visualizer_2014-04-22.zip"], + "sha1" : "220488d87affb569b893c7201f8ce5d2b0e03141", + }, + + "JOL_INTERNALS" : { + "path" : "lib/jol-internals.jar", + "urls" : ["http://lafo.ssw.uni-linz.ac.at/truffle/jol/jol-internals.jar"], + "sha1" : "508bcd26a4d7c4c44048990c6ea789a3b11a62dc", + }, + + "FINDBUGS" : { + "path" : "jvmci/findbugs-SuppressFBWarnings.jar", + "sha1" : "fb78822d27c68fabf2cb2e5e573b3cdb5f9cae2d", + }, + + "DACAPO" : { + "path" : "lib/dacapo-9.12-bach.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/dacapo-9.12-bach.jar", + "http://softlayer.dl.sourceforge.net/project/dacapobench/9.12-bach/dacapo-9.12-bach.jar", + ], + "sha1" : "2626a9546df09009f6da0df854e6dc1113ef7dd4", + }, + + "JACOCOAGENT" : { + "path" : "lib/jacocoagent.jar", + "urls" : ["http://lafo.ssw.uni-linz.ac.at/jacoco/jacocoagent-0.7.1-1.jar"], + "sha1" : "2f73a645b02e39290e577ce555f00b02004650b0", + }, + + "JACOCOREPORT" : { + "path" : "lib/jacocoreport.jar", + "urls" : ["http://lafo.ssw.uni-linz.ac.at/jacoco/jacocoreport-0.7.1-2.jar"], + "sha1" : "a630436391832d697a12c8f7daef8655d7a1efd2", + }, + + "DACAPO_SCALA" : { + "path" : "lib/dacapo-scala-0.1.0-20120216.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/dacapo-scala-0.1.0-20120216.jar", + "http://repo.scalabench.org/snapshots/org/scalabench/benchmarks/scala-benchmark-suite/0.1.0-SNAPSHOT/scala-benchmark-suite-0.1.0-20120216.103539-3.jar", + ], + "sha1" : "59b64c974662b5cf9dbd3cf9045d293853dd7a51", + }, + + "JAVA_ALLOCATION_INSTRUMENTER" : { + "path" : "lib/java-allocation-instrumenter.jar", + "sourcePath" : "lib/java-allocation-instrumenter.jar", + "urls" : ["http://lafo.ssw.uni-linz.ac.at/java-allocation-instrumenter/java-allocation-instrumenter-8f0db117e64e.jar"], + "sha1" : "476d9a44cd19d6b55f81571077dfa972a4f8a083", + "bootClassPathAgent" : "true", + }, + + "VECMATH" : { + "path" : "lib/vecmath-1.3.1.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/vecmath-1.3.1.jar", + "https://search.maven.org/remotecontent?filepath=java3d/vecmath/1.3.1/vecmath-1.3.1.jar", + ], + "sha1" : "a0ae4f51da409fa0c20fa0ca59e6bbc9413ae71d", + }, + + "JMH" : { + "path" : "lib/jmh-runner-1.4.2.jar", + "sha1" : "f44bffaf237305512002303a306fc5ce3fa63f76", + "urls" : ["http://lafo.ssw.uni-linz.ac.at/jmh/jmh-runner-1.4.2.jar"], + "annotationProcessor" : "true" + }, + + "BATIK" : { + "path" : "lib/batik-all-1.7.jar", + "sha1" : "122b87ca88e41a415cf8b523fd3d03b4325134a3", + "urls" : ["http://lafo.ssw.uni-linz.ac.at/graal-external-deps/batik-all-1.7.jar"], + }, + + # ------------- Truffle ------------- + + "TRUFFLE" : { + "path" : "lib/truffle-0.8-SNAPSHOT.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle/0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-SNAPSHOT/truffle-0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-20150616.114821-1.jar", + ], + "sha1" : "34be0993d8fcaa21129749a329e4bb7841cf27e1", + }, + "TRUFFLE_TCK" : { + "path" : "lib/truffle-tck-0.8-SNAPSHOT.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-tck/0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-SNAPSHOT/truffle-tck-0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-20150616.114824-1.jar", + ], + "sha1" : "e56929575aebba40c5a38f8368826831f79fbff0", + }, + "TRUFFLE_DSL_PROCESSOR" : { + "path" : "lib/truffle-dsl-processor-0.8-SNAPSHOT.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-dsl-processor/0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-SNAPSHOT/truffle-dsl-processor-0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-20150616.114822-1.jar", + ], + "sha1" : "242e4126d9857691386631120e658dbda385f984", + "annotationProcessor" : "true", + "dependencies" : ["TRUFFLE"] + }, + "TRUFFLE_SL" : { + "path" : "lib/truffle-sl-0.8-SNAPSHOT.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-sl/0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-SNAPSHOT/truffle-sl-0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-20150616.114825-1.jar", + ], + "sha1" : "bf3f09792dc8fab2bd55bf94ddc69859692cbd27", + } + }, + + "jrelibraries" : { + "JFR" : { + "jar" : "jfr.jar", + } + }, + + "projects" : { + + # ------------- JVMCI:Service ------------- + + "com.oracle.jvmci.service" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,JVMCI", + }, + + "com.oracle.jvmci.service.processor" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.service"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,Codegen,HotSpot", + }, + + # ------------- JVMCI:API ------------- + + "com.oracle.jvmci.common" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,JVMCI", + }, + + "com.oracle.jvmci.meta" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,JVMCI", + }, + + "com.oracle.jvmci.code" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.meta"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,JVMCI", + }, + + "com.oracle.jvmci.runtime" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.code" + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,JVMCI", + }, + + "com.oracle.jvmci.runtime.test" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "JUNIT", + "com.oracle.jvmci.common", + "com.oracle.jvmci.runtime", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,JVMCI", + }, + + "com.oracle.jvmci.debug" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "dependencies" : [ + "com.oracle.jvmci.options", + "com.oracle.jvmci.code", + "com.oracle.jvmci.service", + ], + "annotationProcessors" : ["com.oracle.jvmci.options.processor"], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,Debug", + }, + + "com.oracle.jvmci.debug.test" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "JUNIT", + "com.oracle.jvmci.debug", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,Debug,Test", + }, + + "com.oracle.jvmci.options" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI", + }, + + "com.oracle.jvmci.compiler" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.debug", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.options.processor"], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI", + }, + + "com.oracle.jvmci.options.processor" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.options", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,Codegen", + }, + + "com.oracle.jvmci.options.test" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.options", + "JUNIT", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.options.processor"], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI", + }, + + # ------------- JVMCI:HotSpot ------------- + + "com.oracle.jvmci.amd64" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.code"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,AMD64", + }, + + "com.oracle.jvmci.sparc" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.code"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,SPARC", + }, + + "com.oracle.jvmci.hotspot" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.hotspotvmconfig", + "FINDBUGS", + "com.oracle.jvmci.runtime", + "com.oracle.jvmci.common", + "com.oracle.jvmci.compiler", + ], + "annotationProcessors" : [ + "com.oracle.jvmci.hotspotvmconfig.processor", + "com.oracle.jvmci.options.processor", + "com.oracle.jvmci.service.processor", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI", + }, + + "com.oracle.jvmci.hotspotvmconfig" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot", + }, + + "com.oracle.jvmci.hotspotvmconfig.processor" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.hotspotvmconfig", "com.oracle.jvmci.common"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot,Codegen", + }, + + "com.oracle.jvmci.hotspot.amd64" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.amd64", + "com.oracle.jvmci.hotspot", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot,AMD64", + }, + + "com.oracle.jvmci.hotspot.sparc" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.sparc", + "com.oracle.jvmci.hotspot", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot,SPARC", + }, + + "com.oracle.jvmci.hotspot.jfr" : { + "subDir" : "jvmci", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.hotspot", + "JFR", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "javaCompliance" : "1.8", + "profile" : "", + "workingSets" : "JVMCI,HotSpot", + }, + + # ------------- NFI ------------- + + "com.oracle.nfi" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.7", + }, + + "com.oracle.nfi.test" : { + "subDir" : "graal", + "sourceDirs" : ["test"], + "dependencies" : [ + "com.oracle.nfi", + "com.oracle.jvmci.common", + "JUNIT", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.7", + }, + + # ------------- Graal ------------- + + "com.oracle.graal.code" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.service", + "com.oracle.jvmci.code", + ], + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal", + }, + + "com.oracle.graal.api.collections" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,Graal", + }, + + "com.oracle.graal.api.directives" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,Graal", + }, + + "com.oracle.graal.api.directives.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "dependencies" : [ + "com.oracle.graal.compiler.test", + ], + "javaCompliance" : "1.8", + "workingSets" : "API,Graal", + }, + + "com.oracle.graal.api.runtime" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.service", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,Graal", + }, + + "com.oracle.graal.api.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "JUNIT", + "com.oracle.graal.api.runtime", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,Graal,Test", + }, + + "com.oracle.graal.api.replacements" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.meta"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,Graal,Replacements", + }, + + "com.oracle.graal.hotspot" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.hotspot", + "com.oracle.graal.replacements", + "com.oracle.graal.runtime", + "com.oracle.graal.code", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : [ + "com.oracle.graal.replacements.verifier", + "com.oracle.jvmci.service.processor", + ], + "javaCompliance" : "1.8", + "workingSets" : "Graal,HotSpot", + }, + + "com.oracle.graal.hotspot.amd64" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.hotspot.amd64", + "com.oracle.graal.compiler.amd64", + "com.oracle.graal.hotspot", + "com.oracle.graal.replacements.amd64", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "javaCompliance" : "1.8", + "workingSets" : "Graal,HotSpot,AMD64", + }, + + "com.oracle.graal.hotspot.sparc" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.hotspot", + "com.oracle.jvmci.hotspot.sparc", + "com.oracle.graal.compiler.sparc", + "com.oracle.graal.replacements.sparc", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor", "com.oracle.graal.compiler.match.processor"], + "javaCompliance" : "1.8", + "workingSets" : "Graal,HotSpot,SPARC", + }, + + "com.oracle.graal.hotspot.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.replacements.test", + "com.oracle.graal.hotspot", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,HotSpot,Test", + }, + + "com.oracle.graal.hotspot.amd64.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.asm.amd64", + "com.oracle.graal.hotspot.test", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,HotSpot,AMD64,Test", + }, + + "com.oracle.graal.nodeinfo" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Graph", + }, + + "com.oracle.graal.nodeinfo.processor" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "dependencies" : [ + "com.oracle.graal.nodeinfo", + ], + "javaCompliance" : "1.8", + "workingSets" : "Graal,Graph", + }, + + "com.oracle.graal.graph" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.nodeinfo", + "com.oracle.graal.compiler.common", + "com.oracle.graal.api.collections", + "com.oracle.graal.api.runtime", + "FINDBUGS", + ], + "javaCompliance" : "1.8", + "annotationProcessors" : ["com.oracle.graal.nodeinfo.processor"], + "workingSets" : "Graal,Graph", + }, + + "com.oracle.graal.graph.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "dependencies" : [ + "JUNIT", + "com.oracle.graal.graph", + ], + "javaCompliance" : "1.8", + "workingSets" : "Graal,Graph,Test", + }, + + "com.oracle.graal.asm" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.code"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Assembler", + }, + + "com.oracle.graal.asm.amd64" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.asm", + "com.oracle.jvmci.amd64", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Assembler,AMD64", + }, + + "com.oracle.graal.asm.sparc" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.asm", + "com.oracle.jvmci.sparc", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Assembler,SPARC", + }, + + "com.oracle.graal.bytecode" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Java", + }, + + "com.oracle.graal.asm.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.code", + "com.oracle.graal.test", + "com.oracle.jvmci.debug", + "com.oracle.jvmci.runtime", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Assembler,Test", + }, + + "com.oracle.graal.asm.amd64.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.asm.test", + "com.oracle.jvmci.common", + "com.oracle.graal.asm.amd64", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Assembler,AMD64,Test", + }, + + "com.oracle.graal.lir" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.compiler.common", + "com.oracle.graal.asm", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,LIR", + }, + + "com.oracle.graal.lir.jtt" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.jtt", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,LIR", + }, + + "com.oracle.graal.lir.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "JUNIT", + "com.oracle.graal.lir", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,LIR", + }, + + "com.oracle.graal.lir.amd64" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.lir", + "com.oracle.graal.asm.amd64", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,LIR,AMD64", + }, + + "com.oracle.graal.lir.sparc" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.asm.sparc", + "com.oracle.graal.lir", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,LIR,SPARC", + }, + + "com.oracle.graal.word" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.graal.nodes"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,Graal", + }, + + "com.oracle.graal.replacements" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.api.directives", + "com.oracle.graal.java", + "com.oracle.graal.loop", + "com.oracle.graal.word", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "annotationProcessors" : [ + "com.oracle.graal.replacements.verifier", + "com.oracle.jvmci.service.processor", + ], + "workingSets" : "Graal,Replacements", + }, + + "com.oracle.graal.replacements.amd64" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.replacements", + "com.oracle.graal.lir.amd64", + "com.oracle.graal.compiler", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "workingSets" : "Graal,Replacements,AMD64", + }, + + "com.oracle.graal.replacements.sparc" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.replacements", + "com.oracle.graal.compiler", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Replacements,SPARC", + }, + + "com.oracle.graal.replacements.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.compiler.test", + "com.oracle.graal.replacements", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Replacements,Test", + "jacoco" : "exclude", + }, + + "com.oracle.graal.replacements.verifier" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.api.replacements", + "com.oracle.graal.graph", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Replacements", + }, + + "com.oracle.graal.nodes" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.graph", + "com.oracle.graal.api.replacements", + "com.oracle.graal.lir", + "com.oracle.graal.bytecode", + "com.oracle.jvmci.compiler", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "annotationProcessors" : ["com.oracle.graal.replacements.verifier"], + "workingSets" : "Graal,Graph", + }, + + "com.oracle.graal.nodes.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.graal.compiler.test"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Graph", + }, + + "com.oracle.graal.phases" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.graal.nodes"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Phases", + }, + + "com.oracle.graal.phases.common" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.graal.phases"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Phases", + }, + + "com.oracle.graal.phases.common.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.runtime", + "JUNIT", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Test", + }, + + "com.oracle.graal.virtual" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.graal.phases.common"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Phases", + }, + + "com.oracle.graal.virtual.bench" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["JMH"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Bench", + }, + + "com.oracle.graal.loop" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.graal.phases.common"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Phases", + }, + + "com.oracle.graal.compiler" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.virtual", + "com.oracle.graal.loop", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "workingSets" : "Graal", + }, + + "com.oracle.graal.compiler.match.processor" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.compiler", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Codegen", + }, + + "com.oracle.graal.compiler.amd64" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.compiler", + "com.oracle.graal.lir.amd64", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.graal.compiler.match.processor"], + "javaCompliance" : "1.8", + "workingSets" : "Graal,AMD64", + }, + + "com.oracle.graal.compiler.amd64.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.amd64", + "com.oracle.graal.lir.jtt", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,AMD64,Test", + }, + + "com.oracle.graal.compiler.sparc" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.compiler", + "com.oracle.graal.lir.sparc" + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,SPARC", + }, + + "com.oracle.graal.compiler.sparc.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.sparc", + "com.oracle.graal.compiler.test", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,SPARC,Test", + }, + + "com.oracle.graal.runtime" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.graal.compiler"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal", + }, + + "com.oracle.graal.java" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.phases", + "com.oracle.graal.graphbuilderconf", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "javaCompliance" : "1.8", + "workingSets" : "Graal,Java", + }, + + "com.oracle.graal.graphbuilderconf" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.nodes", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Java", + }, + + "com.oracle.graal.compiler.common" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.debug", + "com.oracle.jvmci.common", + ], + "annotationProcessors" : ["com.oracle.jvmci.options.processor"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Java", + }, + + "com.oracle.graal.printer" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.code", + "com.oracle.graal.java", + "com.oracle.graal.compiler", + ], + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Graph", + }, + + "com.oracle.graal.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "JUNIT", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Test", + }, + + "com.oracle.graal.compiler.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.api.directives", + "com.oracle.graal.java", + "com.oracle.graal.test", + "com.oracle.graal.runtime", + "JAVA_ALLOCATION_INSTRUMENTER", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Test", + "jacoco" : "exclude", + }, + + "com.oracle.graal.jtt" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.compiler.test", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Test", + "jacoco" : "exclude", + }, + + # ------------- GraalTruffle ------------- + + "com.oracle.truffle.all" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "TRUFFLE", + "TRUFFLE_DSL_PROCESSOR", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.7", + "workingSets" : "Graal,Truffle", + "jacoco" : "exclude", + }, + + "com.oracle.graal.truffle" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "TRUFFLE", + "TRUFFLE_DSL_PROCESSOR", + "com.oracle.graal.runtime", + "com.oracle.graal.replacements", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Truffle", + "jacoco" : "exclude", + }, + + "com.oracle.graal.truffle.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.truffle", + "com.oracle.graal.graph.test", + "com.oracle.graal.compiler.test", + "TRUFFLE_SL", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "Graal,Truffle,Test", + "jacoco" : "exclude", + }, + + "com.oracle.graal.truffle.hotspot" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.truffle", + "com.oracle.graal.hotspot", + "com.oracle.nfi", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "workingSets" : "Graal,Truffle", + }, + + "com.oracle.graal.truffle.hotspot.amd64" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.truffle.hotspot", + "com.oracle.graal.hotspot.amd64", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "workingSets" : "Graal,Truffle", + }, + + "com.oracle.graal.truffle.hotspot.sparc" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.graal.truffle.hotspot", + "com.oracle.graal.asm.sparc", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "workingSets" : "Graal,Truffle,SPARC", + } + }, + + "distributions" : { + + # ------------- Distributions ------------- + + "JVMCI_SERVICE" : { + "path" : "build/jvmci-service.jar", + "subDir" : "graal", + "sourcesPath" : "build/jvmci-service.src.zip", + "dependencies" : ["com.oracle.jvmci.service"], + "exclude" : ["FINDBUGS"], + }, + + "JVMCI_API" : { + "path" : "build/jvmci-api.jar", + "subDir" : "graal", + "sourcesPath" : "build/jvmci-api.src.zip", + "dependencies" : [ + "com.oracle.jvmci.runtime", + "com.oracle.jvmci.options", + "com.oracle.jvmci.common", + "com.oracle.jvmci.debug", + ], + "exclude" : ["FINDBUGS"], + "distDependencies" : [ + "JVMCI_SERVICE", + ], + }, + + "JVMCI_HOTSPOT" : { + "path" : "build/jvmci-hotspot.jar", + "subDir" : "graal", + "sourcesPath" : "build/jvmci-hotspot.src.zip", + "dependencies" : [ + "com.oracle.jvmci.hotspot.amd64", + "com.oracle.jvmci.hotspot.sparc", + "com.oracle.jvmci.hotspot.jfr", + ], + "distDependencies" : [ + "JVMCI_API", + ], + }, + + "GRAAL" : { + "path" : "build/graal.jar", + "subDir" : "graal", + "sourcesPath" : "build/graal.src.zip", + "dependencies" : [ + "com.oracle.graal.hotspot.amd64", + "com.oracle.graal.hotspot.sparc", + "com.oracle.graal.hotspot", + "com.oracle.graal.printer", + ], + "exclude" : ["FINDBUGS"], + "distDependencies" : [ + "JVMCI_SERVICE", + "JVMCI_HOTSPOT", + ], + }, + + "TRUFFLE" : { + "path" : "build/truffle.jar", + "subDir" : "graal", + "sourcesPath" : "build/truffle.src.zip", + "javaCompliance" : "1.7", + "dependencies" : [ + "com.oracle.truffle.all", + "com.oracle.nfi", + ], + }, + + "GRAAL_TRUFFLE" : { + "path" : "build/graal-truffle.jar", + "subDir" : "graal", + "sourcesPath" : "build/graal-truffle.src.zip", + "dependencies" : [ + "com.oracle.graal.truffle", + "com.oracle.graal.truffle.hotspot.amd64", + "com.oracle.graal.truffle.hotspot.sparc" + ], + "exclude" : ["FINDBUGS"], + "distDependencies" : [ + "GRAAL", + "TRUFFLE", + ], + }, + }, +}
--- a/mx/.project Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>mx</name> - <comment></comment> - <projects> - <project>mxtool</project> - </projects> - <buildSpec> - <buildCommand> - <name>org.python.pydev.PyDevBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.python.pydev.pythonNature</nature> - </natures> -</projectDescription>
--- a/mx/.pydevproject Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?eclipse-pydev version="1.0"?> - -<pydev_project> -<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> -<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property> -<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> -<path>/mx</path> -</pydev_pathproperty> -<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> -<path>/mxtool</path> -</pydev_pathproperty> - -</pydev_project>
--- a/mx/eclipse-settings/org.eclipse.core.resources.prefs Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/<project>=UTF-8
--- a/mx/eclipse-settings/org.eclipse.jdt.apt.core.prefs Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.apt.aptEnabled=true -org.eclipse.jdt.apt.genSrcDir=src_gen -org.eclipse.jdt.apt.reconcileEnabled=true
--- a/mx/eclipse-settings/org.eclipse.jdt.core.prefs Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,417 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=${javaCompliance} -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=${javaCompliance} -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=ignore -org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.processAnnotations=disabled -org.eclipse.jdt.core.compiler.source=${javaCompliance} -org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled -org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL -org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=48 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=49 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=48 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=4 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=200 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=false -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error
--- a/mx/eclipse-settings/org.eclipse.jdt.ui.prefs Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -cleanup.add_default_serial_version_id=false -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=false -cleanup.add_missing_deprecated_annotations=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=false -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=false -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.format_source_code=false -cleanup.make_local_variable_final=false -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=false -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false -cleanup.qualify_static_member_accesses_with_declaring_class=false -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=false -cleanup.remove_trailing_whitespaces=false -cleanup.remove_trailing_whitespaces_all=false -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=false -cleanup.remove_unnecessary_nls_tags=false -cleanup.remove_unused_imports=false -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=false -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=false -cleanup.remove_unused_private_types=false -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=false -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=false -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=false -cleanup_profile=_CleanUpAgitarTests -cleanup_settings_version=2 -comment_clear_blank_lines=false -comment_format_comments=true -comment_format_header=false -comment_format_html=true -comment_format_source_code=true -comment_indent_parameter_description=true -comment_indent_root_tags=true -comment_line_length=120 -comment_new_line_for_parameter=true -comment_separate_root_tags=true -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_Graal -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=false -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=0 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=0 -sp_cleanup.add_default_serial_version_id=false -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=false -sp_cleanup.add_missing_deprecated_annotations=false -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=false -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=false -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=false -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=false -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=false -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=false -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=false -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=false -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=false -sp_cleanup.remove_unused_private_types=false -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
--- a/mx/mx_graal.py Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2657 +0,0 @@ -# -# commands.py - the GraalVM specific commands -# -# ---------------------------------------------------------------------------------------------------- -# -# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# ---------------------------------------------------------------------------------------------------- - -import os, stat, errno, sys, shutil, zipfile, tarfile, tempfile, re, time, datetime, platform, subprocess, StringIO, socket -from os.path import join, exists, dirname, basename -from argparse import ArgumentParser, RawDescriptionHelpFormatter, REMAINDER -from outputparser import OutputParser, ValuesMatcher -import mx -import xml.dom.minidom -import sanitycheck -import itertools -import json, textwrap -import fnmatch -import mx_graal_makefile - -# This works because when mx loads this file, it makes sure __file__ gets an absolute path -_graal_home = dirname(dirname(__file__)) - -""" Used to distinguish an exported GraalVM (see 'mx export'). """ -_vmSourcesAvailable = exists(join(_graal_home, 'make')) and exists(join(_graal_home, 'src')) - -""" The VMs that can be built and run along with an optional description. Only VMs with a - description are listed in the dialogue for setting the default VM (see _get_vm()). """ -_vmChoices = { - 'jvmci' : 'Normal compilation is performed with a tiered system (C1 + Graal), Truffle compilation is performed with Graal.', - 'server' : 'Normal compilation is performed with a tiered system (C1 + C2), Truffle compilation is performed with Graal. Use this for optimal Truffle performance.', - 'client' : None, # normal compilation with client compiler, explicit compilation (e.g., by Truffle) with Graal - 'server-nojvmci' : None, # all compilation with tiered system (i.e., client + server), JVMCI omitted - 'client-nojvmci' : None, # all compilation with client compiler, JVMCI omitted - 'original' : None, # default VM copied from bootstrap JDK - 'graal' : None, # alias for jvmci - 'server-nograal' : None, # alias for server-nojvmci - 'client-nograal' : None, # alias for client-nojvmci -} - -""" The VM that will be run by the 'vm' command and built by default by the 'build' command. - This can be set via the global '--vm' option or the DEFAULT_VM environment variable. - It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ -_vm = None - -""" The VM builds that will be run by the 'vm' command - default is first in list """ -_vmbuildChoices = ['product', 'fastdebug', 'debug', 'optimized'] - -""" The VM build that will be run by the 'vm' command. - This can be set via the global '--vmbuild' option. - It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ -_vmbuild = _vmbuildChoices[0] - -_jacoco = 'off' - -""" The current working directory to switch to before running the VM. """ -_vm_cwd = None - -""" The base directory in which the JDKs cloned from $JAVA_HOME exist. """ -_installed_jdks = None - -""" Prefix for running the VM. """ -_vm_prefix = None - -_make_eclipse_launch = False - -_minVersion = mx.VersionSpec('1.8') - -# max version (first _unsupported_ version) -_untilVersion = None - -class JDKDeployedDist: - def __init__(self, name, isExtension=False, usesJVMCIClassLoader=False, partOfHotSpot=False): - self.name = name - self.isExtension = isExtension - self.usesJVMCIClassLoader = usesJVMCIClassLoader - self.partOfHotSpot = partOfHotSpot # true when this distribution is delivered with HotSpot - -_jdkDeployedDists = [ - JDKDeployedDist('TRUFFLE'), - JDKDeployedDist('JVMCI_SERVICE', partOfHotSpot=True), - JDKDeployedDist('JVMCI_API', usesJVMCIClassLoader=True, partOfHotSpot=True), - JDKDeployedDist('JVMCI_HOTSPOT', usesJVMCIClassLoader=True, partOfHotSpot=True), - JDKDeployedDist('GRAAL', usesJVMCIClassLoader=True), - JDKDeployedDist('GRAAL_TRUFFLE', usesJVMCIClassLoader=True) -] - -JDK_UNIX_PERMISSIONS_DIR = 0755 -JDK_UNIX_PERMISSIONS_FILE = 0644 -JDK_UNIX_PERMISSIONS_EXEC = 0755 - -def isVMSupported(vm): - if 'client' == vm and len(platform.mac_ver()[0]) != 0: - # Client VM not supported: java launcher on Mac OS X translates '-client' to '-server' - return False - return True - -def _get_vm(): - """ - Gets the configured VM, presenting a dialogue if there is no currently configured VM. - """ - global _vm - if _vm: - return _vm - vm = mx.get_env('DEFAULT_VM') - envPath = join(_graal_home, 'mx', 'env') - if vm and 'graal' in vm: - if exists(envPath): - with open(envPath) as fp: - if 'DEFAULT_VM=' + vm in fp.read(): - mx.log('Please update the DEFAULT_VM value in ' + envPath + ' to replace "graal" with "jvmci"') - vm = vm.replace('graal', 'jvmci') - if vm is None: - if not mx.is_interactive(): - mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') - mx.log('Please select the VM to be executed from the following: ') - items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] - descriptions = [_vmChoices[k] for k in _vmChoices.keys() if _vmChoices[k] is not None] - vm = mx.select_items(items, descriptions, allowMultiple=False) - mx.ask_persist_env('DEFAULT_VM', vm) - _vm = vm - return vm - -""" -A context manager that can be used with the 'with' statement to set the VM -used by all VM executions within the scope of the 'with' statement. For example: - - with VM('server'): - dacapo(['pmd']) -""" -class VM: - def __init__(self, vm=None, build=None): - assert vm is None or vm in _vmChoices.keys() - assert build is None or build in _vmbuildChoices - self.vm = vm if vm else _vm - self.build = build if build else _vmbuild - self.previousVm = _vm - self.previousBuild = _vmbuild - - def __enter__(self): - global _vm, _vmbuild - _vm = self.vm - _vmbuild = self.build - - def __exit__(self, exc_type, exc_value, traceback): - global _vm, _vmbuild - _vm = self.previousVm - _vmbuild = self.previousBuild - -def chmodRecursive(dirname, chmodFlagsDir): - if mx.get_os() == 'windows': - return - - def _chmodDir(chmodFlags, dirname, fnames): - os.chmod(dirname, chmodFlagsDir) - - os.path.walk(dirname, _chmodDir, chmodFlagsDir) - -def clean(args): - """clean the source tree""" - opts = mx.clean(args, parser=ArgumentParser(prog='mx clean')) - - if opts.native: - def handleRemoveReadonly(func, path, exc): - excvalue = exc[1] - if mx.get_os() == 'windows' and func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES: - os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) # 0777 - func(path) - else: - raise - - def rmIfExists(name): - if os.path.isdir(name): - shutil.rmtree(name, ignore_errors=False, onerror=handleRemoveReadonly) - elif os.path.isfile(name): - os.unlink(name) - - rmIfExists(join(_graal_home, 'build')) - rmIfExists(join(_graal_home, 'build-nojvmci')) - rmIfExists(_jdksDir()) - -def export(args): - """create archives of builds split by vmbuild and vm""" - - parser = ArgumentParser(prog='mx export') - args = parser.parse_args(args) - - # collect data about export - infos = dict() - infos['timestamp'] = time.time() - - hgcfg = mx.HgConfig() - hgcfg.check() - infos['revision'] = hgcfg.tip('.') + ('+' if hgcfg.isDirty('.') else '') - # TODO: infos['repository'] - - infos['jdkversion'] = str(mx.java().version) - - infos['architecture'] = mx.get_arch() - infos['platform'] = mx.get_os() - - if mx.get_os != 'windows': - pass - # infos['ccompiler'] - # infos['linker'] - - infos['hostname'] = socket.gethostname() - - def _writeJson(suffix, properties): - d = infos.copy() - for k, v in properties.iteritems(): - assert not d.has_key(k) - d[k] = v - - jsonFileName = 'export-' + suffix + '.json' - with open(jsonFileName, 'w') as f: - print >> f, json.dumps(d) - return jsonFileName - - - def _genFileName(archivtype, middle): - idPrefix = infos['revision'] + '_' - idSuffix = '.tar.gz' - return join(_graal_home, "graalvm_" + archivtype + "_" + idPrefix + middle + idSuffix) - - def _genFileArchPlatformName(archivtype, middle): - return _genFileName(archivtype, infos['platform'] + '_' + infos['architecture'] + '_' + middle) - - - # archive different build types of hotspot - for vmBuild in _vmbuildChoices: - jdkpath = join(_jdksDir(), vmBuild) - if not exists(jdkpath): - mx.logv("skipping " + vmBuild) - continue - - tarName = _genFileArchPlatformName('basejdk', vmBuild) - mx.logv("creating basejdk " + tarName) - vmSet = set() - with tarfile.open(tarName, 'w:gz') as tar: - for root, _, files in os.walk(jdkpath): - if basename(root) in _vmChoices.keys(): - # TODO: add some assert to check path assumption - vmSet.add(root) - continue - - for f in files: - name = join(root, f) - # print name - tar.add(name, name) - - n = _writeJson("basejdk-" + vmBuild, {'vmbuild' : vmBuild}) - tar.add(n, n) - - # create a separate archive for each VM - for vm in vmSet: - bVm = basename(vm) - vmTarName = _genFileArchPlatformName('vm', vmBuild + '_' + bVm) - mx.logv("creating vm " + vmTarName) - - debugFiles = set() - with tarfile.open(vmTarName, 'w:gz') as tar: - for root, _, files in os.walk(vm): - for f in files: - # TODO: mac, windows, solaris? - if any(map(f.endswith, [".debuginfo"])): - debugFiles.add(f) - else: - name = join(root, f) - # print name - tar.add(name, name) - - n = _writeJson("vm-" + vmBuild + "-" + bVm, {'vmbuild' : vmBuild, 'vm' : bVm}) - tar.add(n, n) - - if len(debugFiles) > 0: - debugTarName = _genFileArchPlatformName('debugfilesvm', vmBuild + '_' + bVm) - mx.logv("creating debugfilesvm " + debugTarName) - with tarfile.open(debugTarName, 'w:gz') as tar: - for f in debugFiles: - name = join(root, f) - # print name - tar.add(name, name) - - n = _writeJson("debugfilesvm-" + vmBuild + "-" + bVm, {'vmbuild' : vmBuild, 'vm' : bVm}) - tar.add(n, n) - - # graal directory - graalDirTarName = _genFileName('classfiles', 'javac') - mx.logv("creating graal " + graalDirTarName) - with tarfile.open(graalDirTarName, 'w:gz') as tar: - for root, _, files in os.walk("graal"): - for f in [f for f in files if not f.endswith('.java')]: - name = join(root, f) - # print name - tar.add(name, name) - - n = _writeJson("graal", {'javacompiler' : 'javac'}) - tar.add(n, n) - - -def _run_benchmark(args, availableBenchmarks, runBenchmark): - - vmOpts, benchmarksAndOptions = _extract_VM_args(args, useDoubleDash=availableBenchmarks is None) - - if availableBenchmarks is None: - harnessArgs = benchmarksAndOptions - return runBenchmark(None, harnessArgs, vmOpts) - - if len(benchmarksAndOptions) == 0: - mx.abort('at least one benchmark name or "all" must be specified') - benchmarks = list(itertools.takewhile(lambda x: not x.startswith('-'), benchmarksAndOptions)) - harnessArgs = benchmarksAndOptions[len(benchmarks):] - - if 'all' in benchmarks: - benchmarks = availableBenchmarks - else: - for bm in benchmarks: - if bm not in availableBenchmarks: - mx.abort('unknown benchmark: ' + bm + '\nselect one of: ' + str(availableBenchmarks)) - - failed = [] - for bm in benchmarks: - if not runBenchmark(bm, harnessArgs, vmOpts): - failed.append(bm) - - if len(failed) != 0: - mx.abort('Benchmark failures: ' + str(failed)) - -def dacapo(args): - """run one or more DaCapo benchmarks""" - - def launcher(bm, harnessArgs, extraVmOpts): - return sanitycheck.getDacapo(bm, harnessArgs).test(_get_vm(), extraVmOpts=extraVmOpts) - - _run_benchmark(args, sanitycheck.dacapoSanityWarmup.keys(), launcher) - -def scaladacapo(args): - """run one or more Scala DaCapo benchmarks""" - - def launcher(bm, harnessArgs, extraVmOpts): - return sanitycheck.getScalaDacapo(bm, harnessArgs).test(_get_vm(), extraVmOpts=extraVmOpts) - - _run_benchmark(args, sanitycheck.dacapoScalaSanityWarmup.keys(), launcher) - -def _vmLibDirInJdk(jdk): - """ - Get the directory within a JDK where the server and client - subdirectories are located. - """ - mxos = mx.get_os() - if mxos == 'darwin': - return join(jdk, 'jre', 'lib') - if mxos == 'windows' or mxos == 'cygwin': - return join(jdk, 'jre', 'bin') - return join(jdk, 'jre', 'lib', mx.get_arch()) - -def _vmJliLibDirs(jdk): - """ - Get the directories within a JDK where the jli library designates to. - """ - mxos = mx.get_os() - if mxos == 'darwin': - return [join(jdk, 'jre', 'lib', 'jli')] - if mxos == 'windows' or mxos == 'cygwin': - return [join(jdk, 'jre', 'bin'), join(jdk, 'bin')] - return [join(jdk, 'jre', 'lib', mx.get_arch(), 'jli'), join(jdk, 'lib', mx.get_arch(), 'jli')] - -def _vmCfgInJdk(jdk, jvmCfgFile='jvm.cfg'): - """ - Get the jvm.cfg file. - """ - mxos = mx.get_os() - if mxos == "windows" or mxos == "cygwin": - return join(jdk, 'jre', 'lib', mx.get_arch(), jvmCfgFile) - return join(_vmLibDirInJdk(jdk), jvmCfgFile) - -def _jdksDir(): - return os.path.abspath(join(_installed_jdks if _installed_jdks else _graal_home, 'jdk' + str(mx.java().version))) - -def _handle_missing_VM(bld, vm=None): - if not vm: - vm = _get_vm() - mx.log('The ' + bld + ' ' + vm + ' VM has not been created') - if mx.is_interactive(): - if mx.ask_yes_no('Build it now', 'y'): - with VM(vm, bld): - build([]) - return - mx.abort('You need to run "mx --vm ' + vm + ' --vmbuild ' + bld + ' build" to build the selected VM') - -def _jdk(build=None, vmToCheck=None, create=False, installJars=True): - """ - Get the JDK into which Graal is installed, creating it first if necessary. - """ - if not build: - build = _vmbuild if _vmSourcesAvailable else 'product' - jdk = join(_jdksDir(), build) - if create: - srcJdk = mx.java().jdk - if not exists(jdk): - mx.log('Creating ' + jdk + ' from ' + srcJdk) - shutil.copytree(srcJdk, jdk) - - # Make a copy of the default VM so that this JDK can be - # reliably used as the bootstrap for a HotSpot build. - jvmCfg = _vmCfgInJdk(jdk) - if not exists(jvmCfg): - mx.abort(jvmCfg + ' does not exist') - - defaultVM = None - jvmCfgLines = [] - with open(jvmCfg) as f: - for line in f: - if line.startswith('-') and defaultVM is None: - parts = line.split() - if len(parts) == 2: - assert parts[1] == 'KNOWN', parts[1] - defaultVM = parts[0][1:] - jvmCfgLines += ['# default VM is a copy of the unmodified ' + defaultVM + ' VM\n'] - jvmCfgLines += ['-original KNOWN\n'] - else: - # skip lines which we cannot parse (e.g. '-hotspot ALIASED_TO -client') - mx.log("WARNING: skipping not parsable line \"" + line + "\"") - else: - jvmCfgLines += [line] - - assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg - chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) - shutil.move(join(_vmLibDirInJdk(jdk), defaultVM), join(_vmLibDirInJdk(jdk), 'original')) - - if mx.get_os() != 'windows': - os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) - with open(jvmCfg, 'w') as fp: - for line in jvmCfgLines: - fp.write(line) - - # patch 'release' file (append graalvm revision) - releaseFile = join(jdk, 'release') - if exists(releaseFile): - releaseFileLines = [] - with open(releaseFile) as f: - for line in f: - releaseFileLines.append(line) - - if mx.get_os() != 'windows': - os.chmod(releaseFile, JDK_UNIX_PERMISSIONS_FILE) - with open(releaseFile, 'w') as fp: - for line in releaseFileLines: - if line.startswith("SOURCE="): - try: - sourceLine = line[0:-2] # remove last char - hgcfg = mx.HgConfig() - hgcfg.check() - revision = hgcfg.tip('.')[:12] # take first 12 chars - fp.write(sourceLine + ' graal:' + revision + '\"\n') - except: - fp.write(line) - else: - fp.write(line) - - # Install a copy of the disassembler library - try: - hsdis([], copyToDir=_vmLibDirInJdk(jdk)) - except SystemExit: - pass - else: - if not exists(jdk): - if _installed_jdks: - mx.log("The selected JDK directory does not (yet) exist: " + jdk) - _handle_missing_VM(build, vmToCheck) - - if installJars: - for jdkDist in _jdkDeployedDists: - dist = mx.distribution(jdkDist.name) - if exists(dist.path) and jdkDist.partOfHotSpot: - _installDistInJdks(jdkDist) - - if vmToCheck is not None: - jvmCfg = _vmCfgInJdk(jdk) - found = False - with open(jvmCfg) as f: - for line in f: - if line.strip() == '-' + vmToCheck + ' KNOWN': - found = True - break - if not found: - _handle_missing_VM(build, vmToCheck) - - return jdk - -def _updateInstalledJVMCIOptionsFile(jdk): - jvmciOptions = join(_graal_home, 'jvmci.options') - jreLibDir = join(jdk, 'jre', 'lib') - if exists(jvmciOptions): - shutil.copy(jvmciOptions, join(jreLibDir, 'jvmci.options')) - else: - toDelete = join(jreLibDir, 'jvmci.options') - if exists(toDelete): - os.unlink(toDelete) - -def _makeHotspotGeneratedSourcesDir(): - """ - Gets the directory containing all the HotSpot sources generated from - JVMCI Java sources. This directory will be created if it doesn't yet exist. - """ - hsSrcGenDir = join(mx.project('com.oracle.jvmci.hotspot').source_gen_dir(), 'hotspot') - if not exists(hsSrcGenDir): - os.makedirs(hsSrcGenDir) - return hsSrcGenDir - -def _copyToJdk(src, dst, permissions=JDK_UNIX_PERMISSIONS_FILE): - name = os.path.basename(src) - dstLib = join(dst, name) - if mx.get_env('SYMLINK_GRAAL_JAR', None) == 'true': - # Using symlinks is much faster than copying but may - # cause issues if the lib is being updated while - # the VM is running. - if not os.path.islink(dstLib) or not os.path.realpath(dstLib) == src: - if exists(dstLib): - os.remove(dstLib) - os.symlink(src, dstLib) - else: - # do a copy and then a move to get atomic updating (on Unix) - fd, tmp = tempfile.mkstemp(suffix='', prefix=name, dir=dst) - shutil.copyfile(src, tmp) - os.close(fd) - shutil.move(tmp, dstLib) - os.chmod(dstLib, permissions) - -def _extractJVMCIFiles(jdkJars, jvmciJars, servicesDir, optionsDir): - if exists(servicesDir): - shutil.rmtree(servicesDir) - if exists(optionsDir): - shutil.rmtree(optionsDir) - if not exists(servicesDir): - os.makedirs(servicesDir) - if not exists(optionsDir): - os.makedirs(optionsDir) - jvmciServices = {} - optionsFiles = [] - for jar in jvmciJars: - if os.path.isfile(jar): - with zipfile.ZipFile(jar) as zf: - for member in zf.namelist(): - if member.startswith('META-INF/jvmci.services') and member: - service = basename(member) - if service == "": - continue # Zip files may contain empty entries for directories (jar -cf ... creates such) - # we don't handle directories - assert service and member == 'META-INF/jvmci.services/' + service - with zf.open(member) as serviceFile: - providers = jvmciServices.setdefault(service, []) - for line in serviceFile.readlines(): - line = line.strip() - if line: - providers.append(line) - elif member.startswith('META-INF/jvmci.options'): - filename = basename(member) - if filename == "": - continue # Zip files may contain empty entries for directories (jar -cf ... creates such) - # we don't handle directories - assert filename and member == 'META-INF/jvmci.options/' + filename - targetpath = join(optionsDir, filename) - optionsFiles.append(filename) - with zf.open(member) as optionsFile, \ - file(targetpath, "wb") as target: - shutil.copyfileobj(optionsFile, target) - for service, providers in jvmciServices.iteritems(): - fd, tmp = tempfile.mkstemp(prefix=service) - f = os.fdopen(fd, 'w+') - for provider in providers: - f.write(provider + os.linesep) - target = join(servicesDir, service) - f.close() - shutil.move(tmp, target) - if mx.get_os() != 'windows': - os.chmod(target, JDK_UNIX_PERMISSIONS_FILE) - -def _updateJVMCIFiles(jdkDir): - jreJVMCIDir = join(jdkDir, 'jre', 'lib', 'jvmci') - jvmciJars = [join(jreJVMCIDir, e) for e in os.listdir(jreJVMCIDir) if e.endswith('.jar')] - jreJVMCIServicesDir = join(jreJVMCIDir, 'services') - jreJVMCIOptionsDir = join(jreJVMCIDir, 'options') - _extractJVMCIFiles(_getJdkDeployedJars(jdkDir), jvmciJars, jreJVMCIServicesDir, jreJVMCIOptionsDir) - -def _updateGraalPropertiesFile(jreLibDir): - """ - Updates (or creates) 'jreLibDir'/jvmci/graal.properties to set/modify the - graal.version property. - """ - version = graal_version() - graalProperties = join(jreLibDir, 'jvmci', 'graal.properties') - if not exists(graalProperties): - with open(graalProperties, 'w') as fp: - print >> fp, 'graal.version=' + version - else: - content = [] - with open(graalProperties) as fp: - for line in fp: - if line.startswith('graal.version='): - content.append('graal.version=' + version) - else: - content.append(line.rstrip(os.linesep)) - with open(graalProperties, 'w') as fp: - fp.write(os.linesep.join(content)) - -def _installDistInJdks(deployableDist): - """ - Installs the jar(s) for a given Distribution into all existing JVMCI JDKs - """ - dist = mx.distribution(deployableDist.name) - jdks = _jdksDir() - if exists(jdks): - for e in os.listdir(jdks): - jdkDir = join(jdks, e) - jreLibDir = join(jdkDir, 'jre', 'lib') - if exists(jreLibDir): - if deployableDist.isExtension: - targetDir = join(jreLibDir, 'ext') - elif deployableDist.usesJVMCIClassLoader: - targetDir = join(jreLibDir, 'jvmci') - else: - targetDir = jreLibDir - if not exists(targetDir): - os.makedirs(targetDir) - _copyToJdk(dist.path, targetDir) - if dist.sourcesPath: - _copyToJdk(dist.sourcesPath, jdkDir) - if deployableDist.usesJVMCIClassLoader: - # deploy service files - _updateJVMCIFiles(jdkDir) - if dist.name == 'GRAAL': - _updateGraalPropertiesFile(jreLibDir) - -def _getJdkDeployedJars(jdkDir): - """ - Gets jar paths for all deployed distributions in the context of - a given JDK directory. - """ - jreLibDir = join(jdkDir, 'jre', 'lib') - jars = [] - for dist in _jdkDeployedDists: - jar = basename(mx.distribution(dist.name).path) - if dist.isExtension: - jars.append(join(jreLibDir, 'ext', jar)) - elif dist.usesJVMCIClassLoader: - jars.append(join(jreLibDir, 'jvmci', jar)) - else: - jars.append(join(jreLibDir, jar)) - return jars - - -# run a command in the windows SDK Debug Shell -def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo=None): - if respondTo is None: - respondTo = {} - newLine = os.linesep - startToken = 'RUNINDEBUGSHELL_STARTSEQUENCE' - endToken = 'RUNINDEBUGSHELL_ENDSEQUENCE' - - winSDK = mx.get_env('WIN_SDK', 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\') - - if not exists(mx._cygpathW2U(winSDK)): - mx.abort("Could not find Windows SDK : '" + winSDK + "' does not exist") - - winSDKSetEnv = mx._cygpathW2U(join(winSDK, 'Bin', 'SetEnv.cmd')) - if not exists(winSDKSetEnv): - mx.abort("Invalid Windows SDK path (" + winSDK + ") : could not find Bin/SetEnv.cmd (you can use the WIN_SDK environment variable to specify an other path)") - - wincmd = 'cmd.exe /E:ON /V:ON /K "' + mx._cygpathU2W(winSDKSetEnv) + '"' - p = subprocess.Popen(wincmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - stdout = p.stdout - stdin = p.stdin - if logFile: - log = open(logFile, 'w') - ret = False - - def _writeProcess(s): - stdin.write(s + newLine) - - _writeProcess("echo " + startToken) - while True: - # encoding may be None on windows plattforms - if sys.stdout.encoding is None: - encoding = 'utf-8' - else: - encoding = sys.stdout.encoding - - line = stdout.readline().decode(encoding) - if logFile: - log.write(line.encode('utf-8')) - line = line.strip() - mx.log(line) - if line == startToken: - _writeProcess('cd /D ' + workingDir + ' & ' + cmd + ' & echo ' + endToken) - for regex in respondTo.keys(): - match = regex.search(line) - if match: - _writeProcess(respondTo[regex]) - if findInOutput: - match = findInOutput.search(line) - if match: - ret = True - if line == endToken: - if not findInOutput: - _writeProcess('echo ERRXXX%errorlevel%') - else: - break - if line.startswith('ERRXXX'): - if line == 'ERRXXX0': - ret = True - break - _writeProcess("exit") - if logFile: - log.close() - return ret - -def jdkhome(vm=None): - """return the JDK directory selected for the 'vm' command""" - return _jdk(installJars=False) - -def print_jdkhome(args, vm=None): - """print the JDK directory selected for the 'vm' command""" - print jdkhome(vm) - -def buildvars(args): - """describe the variables that can be set by the -D option to the 'mx build' commmand""" - - buildVars = { - 'ALT_BOOTDIR' : 'The location of the bootstrap JDK installation (default: ' + mx.java().jdk + ')', - 'ALT_OUTPUTDIR' : 'Build directory', - 'HOTSPOT_BUILD_JOBS' : 'Number of CPUs used by make (default: ' + str(mx.cpu_count()) + ')', - 'INSTALL' : 'Install the built VM into the JDK? (default: y)', - 'ZIP_DEBUGINFO_FILES' : 'Install zipped debug symbols file? (default: 0)', - } - - mx.log('HotSpot build variables that can be set by the -D option to "mx build":') - mx.log('') - for n in sorted(buildVars.iterkeys()): - mx.log(n) - mx.log(textwrap.fill(buildVars[n], initial_indent=' ', subsequent_indent=' ', width=200)) - - mx.log('') - mx.log('Note that these variables can be given persistent values in the file ' + join(_graal_home, 'mx', 'env') + ' (see \'mx about\').') - -cached_graal_version = None - -def graal_version(dev_suffix='dev'): - global cached_graal_version - - if not cached_graal_version: - # extract latest release tag for graal - try: - tags = [x.split() for x in subprocess.check_output(['hg', '-R', _graal_home, 'tags']).split('\n') if x.startswith("graal-")] - current_id = subprocess.check_output(['hg', '-R', _graal_home, 'log', '--template', '{rev}\n', '--rev', 'tip']).strip() - except: - # not a mercurial repository or hg commands are not available. - tags = None - - if tags and current_id: - sorted_tags = sorted(tags, key=lambda e: [int(x) for x in e[0][len("graal-"):].split('.')], reverse=True) - most_recent_tag_name, most_recent_tag_revision = sorted_tags[0] - most_recent_tag_id = most_recent_tag_revision[:most_recent_tag_revision.index(":")] - most_recent_tag_version = most_recent_tag_name[len("graal-"):] - - # tagged commit is one-off with commit that tags it - if int(current_id) - int(most_recent_tag_id) <= 1: - cached_graal_version = most_recent_tag_version - else: - major, minor = map(int, most_recent_tag_version.split('.')) - cached_graal_version = str(major) + '.' + str(minor + 1) + '-' + dev_suffix - else: - cached_graal_version = 'unknown-{0}-{1}'.format(platform.node(), time.strftime('%Y-%m-%d_%H-%M-%S_%Z')) - - return cached_graal_version - -def build(args, vm=None): - """build the VM binary - - The global '--vm' and '--vmbuild' options select which VM type and build target to build.""" - - # Override to fail quickly if extra arguments are given - # at the end of the command line. This allows for a more - # helpful error message. - class AP(ArgumentParser): - def __init__(self): - ArgumentParser.__init__(self, prog='mx build') - def parse_args(self, args): - result = ArgumentParser.parse_args(self, args) - if len(result.remainder) != 0: - firstBuildTarget = result.remainder[0] - mx.abort('To specify the ' + firstBuildTarget + ' VM build target, you need to use the global "--vmbuild" option. For example:\n' + - ' mx --vmbuild ' + firstBuildTarget + ' build') - return result - - # Call mx.build to compile the Java sources - parser = AP() - parser.add_argument('-D', action='append', help='set a HotSpot build variable (run \'mx buildvars\' to list variables)', metavar='name=value') - - opts2 = mx.build(['--source', '1.7'] + args, parser=parser) - assert len(opts2.remainder) == 0 - - if not _vmSourcesAvailable or not opts2.native: - return - - builds = [_vmbuild] - - if os.environ.get('BUILDING_FROM_IDE', None) == 'true': - build = os.environ.get('IDE_BUILD_TARGET', None) - if build is None or len(build) == 0: - return - if build not in _vmbuildChoices: - mx.abort('VM build "' + build + '" specified by IDE_BUILD_TARGET environment variable is unknown (must be one of ' + - str(_vmbuildChoices) + ')') - builds = [build] - - if vm is None: - vm = _get_vm() - - if vm == 'original': - pass - elif vm.startswith('server'): - buildSuffix = '' - elif vm.startswith('client'): - buildSuffix = '1' - else: - assert vm == 'jvmci', vm - buildSuffix = 'jvmci' - - if _installed_jdks and _installed_jdks != _graal_home: - if not mx.ask_yes_no("Warning: building while --installed-jdks is set (" + _installed_jdks + ") is not recommanded - are you sure you want to continue", 'n'): - mx.abort(1) - - isWindows = platform.system() == 'Windows' or "CYGWIN" in platform.system() - for build in builds: - installJars = vm != 'original' and (isWindows or not opts2.java) - jdk = _jdk(build, create=True, installJars=installJars) - - if vm == 'original': - if build != 'product': - mx.log('only product build of original VM exists') - continue - - if not isVMSupported(vm): - mx.log('The ' + vm + ' VM is not supported on this platform - skipping') - continue - - vmDir = join(_vmLibDirInJdk(jdk), vm) - if not exists(vmDir): - chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) - mx.log('Creating VM directory in JDK: ' + vmDir) - os.makedirs(vmDir) - - def filterXusage(line): - if not 'Xusage.txt' in line: - sys.stderr.write(line + os.linesep) - - # Check if a build really needs to be done - timestampFile = join(vmDir, '.build-timestamp') - if opts2.force or not exists(timestampFile): - mustBuild = True - else: - mustBuild = False - timestamp = os.path.getmtime(timestampFile) - sources = [] - for d in ['src', 'make', join('jvmci', 'com.oracle.jvmci.hotspot', 'src_gen', 'hotspot')]: - for root, dirnames, files in os.walk(join(_graal_home, d)): - # ignore <graal>/src/share/tools - if root == join(_graal_home, 'src', 'share'): - dirnames.remove('tools') - sources += [join(root, name) for name in files] - for f in sources: - if len(f) != 0 and os.path.getmtime(f) > timestamp: - mustBuild = True - break - - if not mustBuild: - mx.logv('[all files in src and make directories are older than ' + timestampFile[len(_graal_home) + 1:] + ' - skipping native build]') - continue - - if isWindows: - t_compilelogfile = mx._cygpathU2W(os.path.join(_graal_home, "graalCompile.log")) - mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin') - - variant = {'client': 'compiler1', 'server': 'compiler2'}.get(vm, vm) - project_config = variant + '_' + build - t_graal_home = mx._cygpathU2W(_graal_home) - _runInDebugShell('msbuild ' + t_graal_home + r'\build\vs-amd64\jvm.vcproj /p:Configuration=' + project_config + ' /target:clean', t_graal_home) - winCompileCmd = r'set HotSpotMksHome=' + mksHome + r'& set OUT_DIR=' + mx._cygpathU2W(jdk) + r'& set JAVA_HOME=' + mx._cygpathU2W(jdk) + r'& set path=%JAVA_HOME%\bin;%path%;%HotSpotMksHome%& cd /D "' + t_graal_home + r'\make\windows"& call create.bat ' + t_graal_home - print winCompileCmd - winCompileSuccess = re.compile(r"^Writing \.vcxproj file:") - if not _runInDebugShell(winCompileCmd, t_graal_home, t_compilelogfile, winCompileSuccess): - mx.log('Error executing create command') - return - winBuildCmd = 'msbuild ' + t_graal_home + r'\build\vs-amd64\jvm.vcxproj /p:Configuration=' + project_config + ' /p:Platform=x64' - if not _runInDebugShell(winBuildCmd, t_graal_home, t_compilelogfile): - mx.log('Error building project') - return - else: - cpus = mx.cpu_count() - makeDir = join(_graal_home, 'make') - runCmd = [mx.gmake_cmd(), '-C', makeDir] - - env = os.environ.copy() - - # These must be passed as environment variables - env.setdefault('LANG', 'C') - env['JAVA_HOME'] = jdk - - def setMakeVar(name, default, env=None): - """Sets a make variable on the command line to the value - of the variable in 'env' with the same name if defined - and 'env' is not None otherwise to 'default' - """ - runCmd.append(name + '=' + (env.get(name, default) if env else default)) - - if opts2.D: - for nv in opts2.D: - name, value = nv.split('=', 1) - setMakeVar(name.strip(), value) - - setMakeVar('ARCH_DATA_MODEL', '64', env=env) - setMakeVar('HOTSPOT_BUILD_JOBS', str(cpus), env=env) - setMakeVar('ALT_BOOTDIR', mx.java().jdk, env=env) - setMakeVar("EXPORT_PATH", jdk) - - setMakeVar('MAKE_VERBOSE', 'y' if mx._opts.verbose else '') - if vm.endswith('nojvmci'): - setMakeVar('INCLUDE_JVMCI', 'false') - setMakeVar('ALT_OUTPUTDIR', join(_graal_home, 'build-nojvmci', mx.get_os()), env=env) - else: - version = graal_version() - setMakeVar('USER_RELEASE_SUFFIX', 'jvmci-' + version) - setMakeVar('INCLUDE_JVMCI', 'true') - setMakeVar('INSTALL', 'y', env=env) - if mx.get_os() == 'darwin' and platform.mac_ver()[0] != '': - # Force use of clang on MacOS - setMakeVar('USE_CLANG', 'true') - if mx.get_os() == 'solaris': - # If using sparcWorks, setup flags to avoid make complaining about CC version - cCompilerVersion = subprocess.Popen('CC -V', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).stderr.readlines()[0] - if cCompilerVersion.startswith('CC: Sun C++'): - compilerRev = cCompilerVersion.split(' ')[3] - setMakeVar('ENFORCE_COMPILER_REV', compilerRev, env=env) - setMakeVar('ENFORCE_CC_COMPILER_REV', compilerRev, env=env) - if build == 'jvmg': - # We want ALL the symbols when debugging on Solaris - setMakeVar('STRIP_POLICY', 'no_strip') - # This removes the need to unzip the *.diz files before debugging in gdb - setMakeVar('ZIP_DEBUGINFO_FILES', '0', env=env) - - if buildSuffix == "1": - setMakeVar("BUILD_CLIENT_ONLY", "true") - - # Clear this variable as having it set can cause very confusing build problems - env.pop('CLASSPATH', None) - - # Issue an env prefix that can be used to run the make on the command line - if not mx._opts.verbose: - mx.log('--------------- make command line ----------------------') - - envPrefix = ' '.join([key + '=' + env[key] for key in env.iterkeys() if not os.environ.has_key(key) or env[key] != os.environ[key]]) - if len(envPrefix): - mx.log('env ' + envPrefix + ' \\') - - runCmd.append(build + buildSuffix) - runCmd.append("docs") - runCmd.append("export_" + build) - - if not mx._opts.verbose: - mx.log(' '.join(runCmd)) - mx.log('--------------------------------------------------------') - mx.run(runCmd, err=filterXusage, env=env) - - jvmCfg = _vmCfgInJdk(jdk) - if not exists(jvmCfg): - mx.abort(jvmCfg + ' does not exist') - - prefix = '-' + vm + ' ' - vmKnown = prefix + 'KNOWN\n' - lines = [] - found = False - with open(jvmCfg) as f: - for line in f: - if line.strip() == vmKnown.strip(): - found = True - lines.append(line) - - if not found: - mx.log('Prepending "' + prefix + 'KNOWN" to ' + jvmCfg) - if mx.get_os() != 'windows': - os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) - with open(jvmCfg, 'w') as f: - written = False - for line in lines: - if line.startswith('#'): - f.write(line) - continue - if not written: - f.write(vmKnown) - if vm == 'jvmci': - # Legacy support - f.write('-graal ALIASED_TO -jvmci\n') - written = True - if line.startswith(prefix): - line = vmKnown - if written: - continue - f.write(line) - - for jdkDist in _jdkDeployedDists: # Install non HotSpot distribution - if not jdkDist.partOfHotSpot: - _installDistInJdks(jdkDist) - if exists(timestampFile): - os.utime(timestampFile, None) - else: - file(timestampFile, 'a') - -def vmg(args): - """run the debug build of VM selected by the '--vm' option""" - return vm(args, vmbuild='debug') - -def vmfg(args): - """run the fastdebug build of VM selected by the '--vm' option""" - return vm(args, vmbuild='fastdebug') - -def _parseVmArgs(args, vm=None, cwd=None, vmbuild=None): - """run the VM selected by the '--vm' option""" - - if vm is None: - vm = _get_vm() - - if not isVMSupported(vm): - mx.abort('The ' + vm + ' is not supported on this platform') - - if cwd is None: - cwd = _vm_cwd - elif _vm_cwd is not None and _vm_cwd != cwd: - mx.abort("conflicting working directories: do not set --vmcwd for this command") - - build = vmbuild if vmbuild else _vmbuild if _vmSourcesAvailable else 'product' - jdk = _jdk(build, vmToCheck=vm, installJars=False) - _updateInstalledJVMCIOptionsFile(jdk) - mx.expand_project_in_args(args) - if _make_eclipse_launch: - mx.make_eclipse_launch(args, 'graal-' + build, name=None, deps=mx.project('com.oracle.graal.hotspot').all_deps([], True)) - if _jacoco == 'on' or _jacoco == 'append': - jacocoagent = mx.library("JACOCOAGENT", True) - # Exclude all compiler tests and snippets - - includes = ['com.oracle.graal.*', 'com.oracle.jvmci.*'] - baseExcludes = [] - for p in mx.projects(): - projsetting = getattr(p, 'jacoco', '') - if projsetting == 'exclude': - baseExcludes.append(p.name) - if projsetting == 'include': - includes.append(p.name + '.*') - - def _filter(l): - # filter out specific classes which are already covered by a baseExclude package - return [clazz for clazz in l if not any([clazz.startswith(package) for package in baseExcludes])] - excludes = [] - for p in mx.projects(): - excludes += _filter(_find_classes_with_annotations(p, None, ['@Snippet', '@ClassSubstitution', '@Test'], includeInnerClasses=True).keys()) - excludes += _filter(p.find_classes_with_matching_source_line(None, lambda line: 'JaCoCo Exclude' in line, includeInnerClasses=True).keys()) - - excludes += [package + '.*' for package in baseExcludes] - agentOptions = { - 'append' : 'true' if _jacoco == 'append' else 'false', - 'bootclasspath' : 'true', - 'includes' : ':'.join(includes), - 'excludes' : ':'.join(excludes), - 'destfile' : 'jacoco.exec' - } - args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args - exe = join(jdk, 'bin', mx.exe_suffix('java')) - pfx = _vm_prefix.split() if _vm_prefix is not None else [] - - if '-version' in args: - ignoredArgs = args[args.index('-version') + 1:] - if len(ignoredArgs) > 0: - mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs)) - - # Unconditionally prepend Truffle to the boot class path. - # This used to be done by the VM itself but was removed to - # separate the VM from Truffle. - truffle_jar = mx.archive(['@TRUFFLE'])[0] - args = ['-Xbootclasspath/p:' + truffle_jar] + args - - args = mx.java().processArgs(args) - return (pfx, exe, vm, args, cwd) - -def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None): - (pfx_, exe_, vm_, args_, cwd) = _parseVmArgs(args, vm, cwd, vmbuild) - return mx.run(pfx_ + [exe_, '-' + vm_] + args_, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout) - -def _find_classes_with_annotations(p, pkgRoot, annotations, includeInnerClasses=False): - """ - Scan the sources of project 'p' for Java source files containing a line starting with 'annotation' - (ignoring preceding whitespace) and return the fully qualified class name for each Java - source file matched in a list. - """ - - matches = lambda line: len([a for a in annotations if line == a or line.startswith(a + '(')]) != 0 - return p.find_classes_with_matching_source_line(pkgRoot, matches, includeInnerClasses) - -def _extract_VM_args(args, allowClasspath=False, useDoubleDash=False, defaultAllVMArgs=True): - """ - Partitions a command line into a leading sequence of HotSpot VM options and the rest. - """ - for i in range(0, len(args)): - if useDoubleDash: - if args[i] == '--': - vmArgs = args[:i] - remainder = args[i + 1:] - return vmArgs, remainder - else: - if not args[i].startswith('-'): - if i != 0 and (args[i - 1] == '-cp' or args[i - 1] == '-classpath'): - if not allowClasspath: - mx.abort('Cannot supply explicit class path option') - else: - continue - vmArgs = args[:i] - remainder = args[i:] - return vmArgs, remainder - - if defaultAllVMArgs: - return args, [] - else: - return [], args - -def _run_tests(args, harness, annotations, testfile, blacklist, whitelist, regex): - - - vmArgs, tests = _extract_VM_args(args) - for t in tests: - if t.startswith('-'): - mx.abort('VM option ' + t + ' must precede ' + tests[0]) - - candidates = {} - for p in mx.projects_opt_limit_to_suites(): - if mx.java().javaCompliance < p.javaCompliance: - continue - for c in _find_classes_with_annotations(p, None, annotations).keys(): - candidates[c] = p - - classes = [] - if len(tests) == 0: - classes = candidates.keys() - projectsCp = mx.classpath([pcp.name for pcp in mx.projects_opt_limit_to_suites() if pcp.javaCompliance <= mx.java().javaCompliance]) - else: - projs = set() - found = False - if len(tests) == 1 and '#' in tests[0]: - words = tests[0].split('#') - if len(words) != 2: - mx.abort("Method specification is class#method: " + tests[0]) - t, method = words - - for c, p in candidates.iteritems(): - # prefer exact matches first - if t == c: - found = True - classes.append(c) - projs.add(p.name) - if not found: - for c, p in candidates.iteritems(): - if t in c: - found = True - classes.append(c) - projs.add(p.name) - if not found: - mx.log('warning: no tests matched by substring "' + t) - elif len(classes) != 1: - mx.abort('More than one test matches substring {0} {1}'.format(t, classes)) - - classes = [c + "#" + method for c in classes] - else: - for t in tests: - if '#' in t: - mx.abort('Method specifications can only be used in a single test: ' + t) - for c, p in candidates.iteritems(): - if t in c: - found = True - classes.append(c) - projs.add(p.name) - if not found: - mx.log('warning: no tests matched by substring "' + t) - projectsCp = mx.classpath(projs) - - if blacklist: - classes = [c for c in classes if not any((glob.match(c) for glob in blacklist))] - - if whitelist: - classes = [c for c in classes if any((glob.match(c) for glob in whitelist))] - - if regex: - classes = [c for c in classes if re.search(regex, c)] - - if len(classes) != 0: - f_testfile = open(testfile, 'w') - for c in classes: - f_testfile.write(c + '\n') - f_testfile.close() - harness(projectsCp, vmArgs) - -def _unittest(args, annotations, prefixCp="", blacklist=None, whitelist=None, verbose=False, fail_fast=False, enable_timing=False, regex=None, color=False, eager_stacktrace=False, gc_after_test=False): - testfile = os.environ.get('MX_TESTFILE', None) - if testfile is None: - (_, testfile) = tempfile.mkstemp(".testclasses", "graal") - os.close(_) - - coreCp = mx.classpath(['com.oracle.graal.test', 'HCFDIS']) - - coreArgs = [] - if verbose: - coreArgs.append('-JUnitVerbose') - if fail_fast: - coreArgs.append('-JUnitFailFast') - if enable_timing: - coreArgs.append('-JUnitEnableTiming') - if color: - coreArgs.append('-JUnitColor') - if eager_stacktrace: - coreArgs.append('-JUnitEagerStackTrace') - if gc_after_test: - coreArgs.append('-JUnitGCAfterTest') - - - def harness(projectsCp, vmArgs): - if _get_vm() != 'jvmci': - prefixArgs = ['-esa', '-ea'] - else: - prefixArgs = ['-XX:-BootstrapJVMCI', '-esa', '-ea'] - if gc_after_test: - prefixArgs.append('-XX:-DisableExplicitGC') - with open(testfile) as fp: - testclasses = [l.rstrip() for l in fp.readlines()] - - # Remove entries from class path that are in graal.jar and - # run the VM in a mode where application/test classes can - # access core Graal classes. - cp = prefixCp + coreCp + os.pathsep + projectsCp - if isJVMCIEnabled(_get_vm()): - excluded = set() - for jdkDist in _jdkDeployedDists: - dist = mx.distribution(jdkDist.name) - excluded.update([d.output_dir() for d in dist.sorted_deps()]) - cp = os.pathsep.join([e for e in cp.split(os.pathsep) if e not in excluded]) - vmArgs = ['-XX:-UseJVMCIClassLoader'] + vmArgs - - # suppress menubar and dock when running on Mac - vmArgs = ['-Djava.awt.headless=true'] + vmArgs - - if len(testclasses) == 1: - # Execute Junit directly when one test is being run. This simplifies - # replaying the VM execution in a native debugger (e.g., gdb). - vm(prefixArgs + vmArgs + ['-cp', mx._separatedCygpathU2W(cp), 'com.oracle.graal.test.GraalJUnitCore'] + coreArgs + testclasses) - else: - vm(prefixArgs + vmArgs + ['-cp', mx._separatedCygpathU2W(cp), 'com.oracle.graal.test.GraalJUnitCore'] + coreArgs + ['@' + mx._cygpathU2W(testfile)]) - - try: - _run_tests(args, harness, annotations, testfile, blacklist, whitelist, regex) - finally: - if os.environ.get('MX_TESTFILE') is None: - os.remove(testfile) - -_unittestHelpSuffix = """ - Unittest options: - - --blacklist <file> run all testcases not specified in the blacklist - --whitelist <file> run only testcases which are included - in the given whitelist - --verbose enable verbose JUnit output - --fail-fast stop after first JUnit test class that has a failure - --enable-timing enable JUnit test timing - --regex <regex> run only testcases matching a regular expression - --color enable colors output - --eager-stacktrace print stacktrace eagerly - --gc-after-test force a GC after each test - - To avoid conflicts with VM options '--' can be used as delimiter. - - If filters are supplied, only tests whose fully qualified name - includes a filter as a substring are run. - - For example, this command line: - - mx unittest -G:Dump= -G:MethodFilter=BC_aload.* -G:+PrintCFG BC_aload - - will run all JUnit test classes that contain 'BC_aload' in their - fully qualified name and will pass these options to the VM: - - -G:Dump= -G:MethodFilter=BC_aload.* -G:+PrintCFG - - To get around command line length limitations on some OSes, the - JUnit class names to be executed are written to a file that a - custom JUnit wrapper reads and passes onto JUnit proper. The - MX_TESTFILE environment variable can be set to specify a - file which will not be deleted once the unittests are done - (unlike the temporary file otherwise used). - - As with all other commands, using the global '-v' before 'unittest' - command will cause mx to show the complete command line - it uses to run the VM. -""" - -def unittest(args): - """run the JUnit tests (all testcases){0}""" - - parser = ArgumentParser(prog='mx unittest', - description='run the JUnit tests', - add_help=False, - formatter_class=RawDescriptionHelpFormatter, - epilog=_unittestHelpSuffix, - ) - parser.add_argument('--blacklist', help='run all testcases not specified in the blacklist', metavar='<path>') - parser.add_argument('--whitelist', help='run testcases specified in whitelist only', metavar='<path>') - parser.add_argument('--verbose', help='enable verbose JUnit output', action='store_true') - parser.add_argument('--fail-fast', help='stop after first JUnit test class that has a failure', action='store_true') - parser.add_argument('--enable-timing', help='enable JUnit test timing', action='store_true') - parser.add_argument('--regex', help='run only testcases matching a regular expression', metavar='<regex>') - parser.add_argument('--color', help='enable color output', action='store_true') - parser.add_argument('--eager-stacktrace', help='print stacktrace eagerly', action='store_true') - parser.add_argument('--gc-after-test', help='force a GC after each test', action='store_true') - - ut_args = [] - delimiter = False - # check for delimiter - while len(args) > 0: - arg = args.pop(0) - if arg == '--': - delimiter = True - break - ut_args.append(arg) - - if delimiter: - # all arguments before '--' must be recognized - parsed_args = parser.parse_args(ut_args) - else: - # parse all know arguments - parsed_args, args = parser.parse_known_args(ut_args) - - if parsed_args.whitelist: - try: - with open(join(_graal_home, parsed_args.whitelist)) as fp: - parsed_args.whitelist = [re.compile(fnmatch.translate(l.rstrip())) for l in fp.readlines() if not l.startswith('#')] - except IOError: - mx.log('warning: could not read whitelist: ' + parsed_args.whitelist) - if parsed_args.blacklist: - try: - with open(join(_graal_home, parsed_args.blacklist)) as fp: - parsed_args.blacklist = [re.compile(fnmatch.translate(l.rstrip())) for l in fp.readlines() if not l.startswith('#')] - except IOError: - mx.log('warning: could not read blacklist: ' + parsed_args.blacklist) - - _unittest(args, ['@Test', '@Parameters'], **parsed_args.__dict__) - -def shortunittest(args): - """alias for 'unittest --whitelist test/whitelist_shortunittest.txt'{0}""" - - args = ['--whitelist', 'test/whitelist_shortunittest.txt'] + args - unittest(args) - -def microbench(args): - """run JMH microbenchmark projects""" - vmArgs, jmhArgs = _extract_VM_args(args, useDoubleDash=True) - - # look for -f in JMH arguments - containsF = False - forking = True - for i in range(len(jmhArgs)): - arg = jmhArgs[i] - if arg.startswith('-f'): - containsF = True - if arg == '-f' and (i+1) < len(jmhArgs): - arg += jmhArgs[i+1] - try: - if int(arg[2:]) == 0: - forking = False - except ValueError: - pass - - # default to -f1 if not specified otherwise - if not containsF: - jmhArgs += ['-f1'] - - # find all projects with a direct JMH dependency - jmhProjects = [] - for p in mx.projects(): - if 'JMH' in p.deps: - jmhProjects.append(p.name) - cp = mx.classpath(jmhProjects) - - # execute JMH runner - args = ['-cp', cp] - if not forking: - args += vmArgs - args += ['org.openjdk.jmh.Main'] - if forking: - (_, _, jvm, _, _) = _parseVmArgs(vmArgs) - args += ['--jvmArgsPrepend', ' '.join(['-' + jvm] + vmArgs)] - vm(args + jmhArgs) - -def buildvms(args): - """build one or more VMs in various configurations""" - - vmsDefault = ','.join(_vmChoices.keys()) - vmbuildsDefault = ','.join(_vmbuildChoices) - - parser = ArgumentParser(prog='mx buildvms') - parser.add_argument('--vms', help='a comma separated list of VMs to build (default: ' + vmsDefault + ')', metavar='<args>', default=vmsDefault) - parser.add_argument('--builds', help='a comma separated list of build types (default: ' + vmbuildsDefault + ')', metavar='<args>', default=vmbuildsDefault) - parser.add_argument('--check-distributions', action='store_true', dest='check_distributions', help='check built distributions for overlap') - parser.add_argument('-n', '--no-check', action='store_true', help='omit running "java -version" after each build') - parser.add_argument('-c', '--console', action='store_true', help='send build output to console instead of log file') - - args = parser.parse_args(args) - vms = args.vms.split(',') - builds = args.builds.split(',') - - allStart = time.time() - check_dists_args = ['--check-distributions'] if args.check_distributions else [] - for v in vms: - if not isVMSupported(v): - mx.log('The ' + v + ' VM is not supported on this platform - skipping') - continue - - for vmbuild in builds: - if v == 'original' and vmbuild != 'product': - continue - if not args.console: - logFile = join(v + '-' + vmbuild + '.log') - log = open(join(_graal_home, logFile), 'wb') - start = time.time() - mx.log('BEGIN: ' + v + '-' + vmbuild + '\t(see: ' + logFile + ')') - verbose = ['-v'] if mx._opts.verbose else [] - # Run as subprocess so that output can be directed to a file - cmd = [sys.executable, '-u', join('mxtool', 'mx.py')] + verbose + ['--vm', v, '--vmbuild', vmbuild, 'build'] + check_dists_args - mx.logv("executing command: " + str(cmd)) - subprocess.check_call(cmd, cwd=_graal_home, stdout=log, stderr=subprocess.STDOUT) - duration = datetime.timedelta(seconds=time.time() - start) - mx.log('END: ' + v + '-' + vmbuild + '\t[' + str(duration) + ']') - else: - with VM(v, vmbuild): - build(check_dists_args) - if not args.no_check: - vmargs = ['-version'] - if v == 'jvmci': - vmargs.insert(0, '-XX:-BootstrapJVMCI') - vm(vmargs, vm=v, vmbuild=vmbuild) - allDuration = datetime.timedelta(seconds=time.time() - allStart) - mx.log('TOTAL TIME: ' + '[' + str(allDuration) + ']') - -class Task: - # None or a list of strings. If not None, only tasks whose title - # matches at least one of the substrings in this list will return - # a non-None value from __enter__. The body of a 'with Task(...) as t' - # statement should check 't' and exit immediately if it is None. - filters = None - filtersExclude = False - - def __init__(self, title, tasks=None): - self.tasks = tasks - self.title = title - if tasks is not None and Task.filters is not None: - if Task.filtersExclude: - self.skipped = any([f in title for f in Task.filters]) - else: - self.skipped = not any([f in title for f in Task.filters]) - else: - self.skipped = False - if not self.skipped: - self.start = time.time() - self.end = None - self.duration = None - mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: BEGIN: ') + title) - def __enter__(self): - assert self.tasks is not None, "using Task with 'with' statement requires to pass the tasks list in the constructor" - if self.skipped: - return None - return self - def __exit__(self, exc_type, exc_value, traceback): - if not self.skipped: - self.tasks.append(self.stop()) - def stop(self): - self.end = time.time() - self.duration = datetime.timedelta(seconds=self.end - self.start) - mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: END: ') + self.title + ' [' + str(self.duration) + ']') - return self - def abort(self, codeOrMessage): - self.end = time.time() - self.duration = datetime.timedelta(seconds=self.end - self.start) - mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: ABORT: ') + self.title + ' [' + str(self.duration) + ']') - mx.abort(codeOrMessage) - return self - -def ctw(args): - """run CompileTheWorld""" - - defaultCtwopts = '-Inline' - - parser = ArgumentParser(prog='mx ctw') - parser.add_argument('--ctwopts', action='store', help='space separated JVMCI options used for CTW compilations (default: --ctwopts="' + defaultCtwopts + '")', default=defaultCtwopts, metavar='<options>') - parser.add_argument('--jar', action='store', help='jar of classes to compiled instead of rt.jar', metavar='<path>') - - args, vmargs = parser.parse_known_args(args) - - if args.ctwopts: - vmargs.append('-G:CompileTheWorldConfig=' + args.ctwopts) - - if args.jar: - jar = os.path.abspath(args.jar) - else: - jar = join(_jdk(installJars=False), 'jre', 'lib', 'rt.jar') - vmargs.append('-G:CompileTheWorldExcludeMethodFilter=sun.awt.X11.*.*') - - vmargs += ['-XX:+CompileTheWorld'] - vm_ = _get_vm() - if isJVMCIEnabled(vm_): - if vm_ == 'jvmci': - vmargs += ['-XX:+BootstrapJVMCI'] - vmargs += ['-G:CompileTheWorldClasspath=' + jar] - else: - vmargs += ['-Xbootclasspath/p:' + jar] - - # suppress menubar and dock when running on Mac; exclude x11 classes as they may cause vm crashes (on Solaris) - vmargs = ['-Djava.awt.headless=true'] + vmargs - - vm(vmargs) - -def _basic_gate_body(args, tasks): - # Build server-hosted-jvmci now so we can run the unit tests - with Task('BuildHotSpotJVMCIHosted: product', tasks) as t: - if t: buildvms(['--vms', 'server', '--builds', 'product', '--check-distributions']) - - # Run unit tests on server-hosted-jvmci - with VM('server', 'product'): - with Task('UnitTests:hosted-product', tasks) as t: - if t: unittest(['--enable-timing', '--verbose', '--fail-fast']) - - # Run unit tests on server-hosted-jvmci with -G:+SSA_LIR - with VM('server', 'product'): - with Task('UnitTestsSSA:hosted-product', tasks) as t: - if t: unittest(['--enable-timing', '--verbose', '--fail-fast', '-G:+SSA_LIR']) - # Run ctw against rt.jar on server-hosted-jvmci - with VM('server', 'product'): - with Task('CTW:hosted-product', tasks) as t: - if t: ctw(['--ctwopts', '-Inline +ExitVMOnException', '-esa', '-G:+CompileTheWorldMultiThreaded', '-G:-CompileTheWorldVerbose']) - - # Build the other VM flavors - with Task('BuildHotSpotGraalOthers: fastdebug,product', tasks) as t: - if t: buildvms(['--vms', 'jvmci,server', '--builds', 'fastdebug,product', '--check-distributions']) - - with VM('jvmci', 'fastdebug'): - with Task('BootstrapWithSystemAssertions:fastdebug', tasks) as t: - if t: vm(['-esa', '-XX:-TieredCompilation', '-version']) - - with VM('jvmci', 'fastdebug'): - with Task('BootstrapEconomyWithSystemAssertions:fastdebug', tasks) as t: - if t: vm(['-esa', '-XX:-TieredCompilation', '-G:CompilerConfiguration=economy', '-version']) - - with VM('jvmci', 'fastdebug'): - with Task('BootstrapWithSystemAssertionsNoCoop:fastdebug', tasks) as t: - if t: vm(['-esa', '-XX:-TieredCompilation', '-XX:-UseCompressedOops', '-version']) - - with VM('jvmci', 'fastdebug'): - with Task('BootstrapWithExceptionEdges:fastdebug', tasks) as t: - if t: vm(['-esa', '-XX:-TieredCompilation', '-G:+StressInvokeWithExceptionNode', '-version']) - - with VM('jvmci', 'product'): - with Task('BootstrapWithGCVerification:product', tasks) as t: - if t: - out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write - vm(['-XX:-TieredCompilation', '-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out) - - with VM('jvmci', 'product'): - with Task('BootstrapWithG1GCVerification:product', tasks) as t: - if t: - out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write - vm(['-XX:-TieredCompilation', '-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out) - - with VM('jvmci', 'product'): - with Task('BootstrapWithRegisterPressure:product', tasks) as t: - if t: - registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if platform.processor() == 'sparc' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14' - vm(['-XX:-TieredCompilation', '-G:RegisterPressure=' + registers, '-esa', '-version']) - - with VM('jvmci', 'product'): - with Task('BootstrapSSAWithRegisterPressure:product', tasks) as t: - if t: - registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if platform.processor() == 'sparc' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14' - vm(['-XX:-TieredCompilation', '-G:+SSA_LIR', '-G:RegisterPressure=' + registers, '-esa', '-version']) - - with VM('jvmci', 'product'): - with Task('BootstrapWithImmutableCode:product', tasks) as t: - if t: vm(['-XX:-TieredCompilation', '-G:+ImmutableCode', '-G:+VerifyPhases', '-esa', '-version']) - - for vmbuild in ['fastdebug', 'product']: - for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild) + sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild): - with Task(str(test) + ':' + vmbuild, tasks) as t: - if t and not test.test('jvmci'): - t.abort(test.name + ' Failed') - - # ensure -Xbatch still works - with VM('jvmci', 'product'): - with Task('DaCapo_pmd:BatchMode:product', tasks) as t: - if t: dacapo(['-Xbatch', 'pmd']) - - # ensure -Xcomp still works - with VM('jvmci', 'product'): - with Task('XCompMode:product', tasks) as t: - if t: vm(['-Xcomp', '-version']) - - if args.jacocout is not None: - jacocoreport([args.jacocout]) - - global _jacoco - _jacoco = 'off' - - with Task('CleanAndBuildIdealGraphVisualizer', tasks) as t: - if t and platform.processor() != 'sparc': - buildxml = mx._cygpathU2W(join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')) - mx.run(['ant', '-f', buildxml, '-q', 'clean', 'build'], env=_igvBuildEnv()) - - # Prevent JVMCI modifications from breaking the standard builds - if args.buildNonJVMCI: - with Task('BuildHotSpotVarieties', tasks) as t: - if t: - buildvms(['--vms', 'client,server', '--builds', 'fastdebug,product']) - if mx.get_os() not in ['windows', 'cygwin']: - buildvms(['--vms', 'server-nojvmci', '--builds', 'product,optimized']) - - for vmbuild in ['product', 'fastdebug']: - for theVm in ['client', 'server']: - if not isVMSupported(theVm): - mx.log('The ' + theVm + ' VM is not supported on this platform') - continue - with VM(theVm, vmbuild): - with Task('DaCapo_pmd:' + theVm + ':' + vmbuild, tasks) as t: - if t: dacapo(['pmd']) - - with Task('UnitTests:' + theVm + ':' + vmbuild, tasks) as t: - if t: unittest(['-XX:CompileCommand=exclude,*::run*', 'graal.api', 'java.test']) - - -def gate(args, gate_body=_basic_gate_body): - """run the tests used to validate a push - - If this command exits with a 0 exit code, then the source code is in - a state that would be accepted for integration into the main repository.""" - - parser = ArgumentParser(prog='mx gate') - parser.add_argument('-j', '--omit-java-clean', action='store_false', dest='cleanJava', help='omit cleaning Java native code') - parser.add_argument('-n', '--omit-native-clean', action='store_false', dest='cleanNative', help='omit cleaning and building native code') - parser.add_argument('-i', '--omit-ide-clean', action='store_false', dest='cleanIde', help='omit cleaning the ide project files') - parser.add_argument('-g', '--only-build-jvmci', action='store_false', dest='buildNonJVMCI', help='only build the JVMCI VM') - parser.add_argument('-t', '--task-filter', help='comma separated list of substrings to select subset of tasks to be run') - parser.add_argument('-x', action='store_true', help='makes --task-filter an exclusion instead of inclusion filter') - parser.add_argument('--jacocout', help='specify the output directory for jacoco report') - - args = parser.parse_args(args) - - global _jacoco - if args.task_filter: - Task.filters = args.task_filter.split(',') - Task.filtersExclude = args.x - elif args.x: - mx.abort('-x option cannot be used without --task-filter option') - - # Force - if not mx._opts.strict_compliance: - mx.log("[gate] forcing strict compliance") - mx._opts.strict_compliance = True - - tasks = [] - total = Task('Gate') - try: - with Task('Check jvmci.make in sync with suite.py', tasks) as t: - if t: - jvmciMake = join('make', 'jvmci.make') - if mx_graal_makefile.build_makefile(['-o', jvmciMake]) != 0: - t.abort('Rerun "mx makefile -o ' + jvmciMake + ' and check-in the modified ' + jvmciMake) - - with Task('Pylint', tasks) as t: - if t: mx.pylint([]) - - def _clean(name='Clean'): - with Task(name, tasks) as t: - if t: - cleanArgs = [] - if not args.cleanNative: - cleanArgs.append('--no-native') - if not args.cleanJava: - cleanArgs.append('--no-java') - clean(cleanArgs) - _clean() - - with Task('IDEConfigCheck', tasks) as t: - if t: - if args.cleanIde: - mx.ideclean([]) - mx.ideinit([]) - - eclipse_exe = mx.get_env('ECLIPSE_EXE') - if eclipse_exe is not None: - with Task('CodeFormatCheck', tasks) as t: - if t and mx.eclipseformat(['-e', eclipse_exe]) != 0: - t.abort('Formatter modified files - run "mx eclipseformat", check in changes and repush') - - with Task('Canonicalization Check', tasks) as t: - if t: - mx.log(time.strftime('%d %b %Y %H:%M:%S - Ensuring mx/projects files are canonicalized...')) - if mx.canonicalizeprojects([]) != 0: - t.abort('Rerun "mx canonicalizeprojects" and check-in the modified mx/suite*.py files.') - - if mx.get_env('JDT'): - with Task('BuildJavaWithEcj', tasks): - if t: build(['-p', '--no-native', '--jdt-warning-as-error']) - _clean('CleanAfterEcjBuild') - - with Task('BuildJavaWithJavac', tasks): - if t: build(['-p', '--no-native', '--force-javac']) - - with Task('Checkstyle', tasks) as t: - if t and mx.checkstyle([]) != 0: - t.abort('Checkstyle warnings were found') - - with Task('Checkheaders', tasks) as t: - if t and checkheaders([]) != 0: - t.abort('Checkheaders warnings were found') - - with Task('FindBugs', tasks) as t: - if t and findbugs([]) != 0: - t.abort('FindBugs warnings were found') - - if exists('jacoco.exec'): - os.unlink('jacoco.exec') - - if args.jacocout is not None: - _jacoco = 'append' - else: - _jacoco = 'off' - - gate_body(args, tasks) - - except KeyboardInterrupt: - total.abort(1) - - except BaseException as e: - import traceback - traceback.print_exc() - total.abort(str(e)) - - total.stop() - - mx.log('Gate task times:') - for t in tasks: - mx.log(' ' + str(t.duration) + '\t' + t.title) - mx.log(' =======') - mx.log(' ' + str(total.duration)) - - if args.task_filter: - Task.filters = None - -def deoptalot(args): - """bootstrap a fastdebug JVMCI VM with DeoptimizeALot and VerifyOops on - - If the first argument is a number, the process will be repeated - this number of times. All other arguments are passed to the VM.""" - count = 1 - if len(args) > 0 and args[0].isdigit(): - count = int(args[0]) - del args[0] - - for _ in range(count): - if not vm(['-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version'], vmbuild='fastdebug') == 0: - mx.abort("Failed") - -def longtests(args): - - deoptalot(['15', '-Xmx48m']) - - dacapo(['100', 'eclipse', '-esa']) - -def _igvJdk(): - v8u20 = mx.VersionSpec("1.8.0_20") - v8u40 = mx.VersionSpec("1.8.0_40") - v8 = mx.VersionSpec("1.8") - def _igvJdkVersionCheck(version): - return version >= v8 and (version < v8u20 or version >= v8u40) - return mx.java(_igvJdkVersionCheck, versionDescription='>= 1.8 and < 1.8.0u20 or >= 1.8.0u40', purpose="building & running IGV").jdk - -def _igvBuildEnv(): - # When the http_proxy environment variable is set, convert it to the proxy settings that ant needs - env = dict(os.environ) - proxy = os.environ.get('http_proxy') - if not (proxy is None) and len(proxy) > 0: - if '://' in proxy: - # Remove the http:// prefix (or any other protocol prefix) - proxy = proxy.split('://', 1)[1] - # Separate proxy server name and port number - proxyName, proxyPort = proxy.split(':', 1) - proxyEnv = '-DproxyHost="' + proxyName + '" -DproxyPort=' + proxyPort - env['ANT_OPTS'] = proxyEnv - - env['JAVA_HOME'] = _igvJdk() - return env - -def igv(args): - """run the Ideal Graph Visualizer""" - logFile = '.ideal_graph_visualizer.log' - with open(join(_graal_home, logFile), 'w') as fp: - mx.logv('[Ideal Graph Visualizer log is in ' + fp.name + ']') - nbplatform = join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'nbplatform') - - # Remove NetBeans platform if it is earlier than the current supported version - if exists(nbplatform): - updateTrackingFile = join(nbplatform, 'platform', 'update_tracking', 'org-netbeans-core.xml') - if not exists(updateTrackingFile): - mx.log('Could not find \'' + updateTrackingFile + '\', removing NetBeans platform') - shutil.rmtree(nbplatform) - else: - dom = xml.dom.minidom.parse(updateTrackingFile) - currentVersion = mx.VersionSpec(dom.getElementsByTagName('module_version')[0].getAttribute('specification_version')) - supportedVersion = mx.VersionSpec('3.43.1') - if currentVersion < supportedVersion: - mx.log('Replacing NetBeans platform version ' + str(currentVersion) + ' with version ' + str(supportedVersion)) - shutil.rmtree(nbplatform) - elif supportedVersion < currentVersion: - mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion)) - - if not exists(nbplatform): - mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]') - - env = _igvBuildEnv() - # make the jar for Batik 1.7 available. - env['IGV_BATIK_JAR'] = mx.library('BATIK').get_path(True) - if mx.run(['ant', '-f', mx._cygpathU2W(join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')), '-l', mx._cygpathU2W(fp.name), 'run'], env=env, nonZeroIsFatal=False): - mx.abort("IGV ant build & launch failed. Check '" + logFile + "'. You can also try to delete 'src/share/tools/IdealGraphVisualizer/nbplatform'.") - -def maven_install_truffle(args): - """install Truffle into your local Maven repository""" - for name in ['TRUFFLE', 'TRUFFLE-DSL-PROCESSOR']: - mx.archive(["@" + name]) - path = mx._dists[name].path - mx.run(['mvn', 'install:install-file', '-DgroupId=com.oracle', '-DartifactId=' + name.lower(), '-Dversion=' + graal_version('SNAPSHOT'), '-Dpackaging=jar', '-Dfile=' + path]) - -def c1visualizer(args): - """run the Cl Compiler Visualizer""" - libpath = join(_graal_home, 'lib') - if mx.get_os() == 'windows': - executable = join(libpath, 'c1visualizer', 'bin', 'c1visualizer.exe') - else: - executable = join(libpath, 'c1visualizer', 'bin', 'c1visualizer') - - # Check whether the current C1Visualizer installation is the up-to-date - if exists(executable) and not exists(mx.library('C1VISUALIZER_DIST').get_path(resolve=False)): - mx.log('Updating C1Visualizer') - shutil.rmtree(join(libpath, 'c1visualizer')) - - archive = mx.library('C1VISUALIZER_DIST').get_path(resolve=True) - - if not exists(executable): - zf = zipfile.ZipFile(archive, 'r') - zf.extractall(libpath) - - if not exists(executable): - mx.abort('C1Visualizer binary does not exist: ' + executable) - - if mx.get_os() != 'windows': - # Make sure that execution is allowed. The zip file does not always specfiy that correctly - os.chmod(executable, 0777) - - mx.run([executable]) - -def bench(args): - """run benchmarks and parse their output for results - - Results are JSON formated : {group : {benchmark : score}}.""" - resultFile = None - if '-resultfile' in args: - index = args.index('-resultfile') - if index + 1 < len(args): - resultFile = args[index + 1] - del args[index] - del args[index] - else: - mx.abort('-resultfile must be followed by a file name') - vm = _get_vm() - if len(args) is 0: - args = ['all'] - - vmArgs = [arg for arg in args if arg.startswith('-')] - - def benchmarks_in_group(group): - prefix = group + ':' - return [a[len(prefix):] for a in args if a.startswith(prefix)] - - results = {} - benchmarks = [] - # DaCapo - if 'dacapo' in args or 'all' in args: - benchmarks += sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) - else: - dacapos = benchmarks_in_group('dacapo') - for dacapo in dacapos: - if dacapo not in sanitycheck.dacapoSanityWarmup.keys(): - mx.abort('Unknown DaCapo : ' + dacapo) - iterations = sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark] - if iterations > 0: - benchmarks += [sanitycheck.getDacapo(dacapo, iterations)] - - if 'scaladacapo' in args or 'all' in args: - benchmarks += sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) - else: - scaladacapos = benchmarks_in_group('scaladacapo') - for scaladacapo in scaladacapos: - if scaladacapo not in sanitycheck.dacapoScalaSanityWarmup.keys(): - mx.abort('Unknown Scala DaCapo : ' + scaladacapo) - iterations = sanitycheck.dacapoScalaSanityWarmup[scaladacapo][sanitycheck.SanityCheckLevel.Benchmark] - if iterations > 0: - benchmarks += [sanitycheck.getScalaDacapo(scaladacapo, ['-n', str(iterations)])] - - # Bootstrap - if 'bootstrap' in args or 'all' in args: - benchmarks += sanitycheck.getBootstraps() - # SPECjvm2008 - if 'specjvm2008' in args or 'all' in args: - benchmarks += [sanitycheck.getSPECjvm2008(['-ikv', '-wt', '120', '-it', '120'])] - else: - specjvms = benchmarks_in_group('specjvm2008') - for specjvm in specjvms: - benchmarks += [sanitycheck.getSPECjvm2008(['-ikv', '-wt', '120', '-it', '120', specjvm])] - - if 'specjbb2005' in args or 'all' in args: - benchmarks += [sanitycheck.getSPECjbb2005()] - - if 'specjbb2013' in args: # or 'all' in args //currently not in default set - benchmarks += [sanitycheck.getSPECjbb2013()] - - if 'ctw-full' in args: - benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.Full)) - if 'ctw-noinline' in args: - benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoInline)) - - for test in benchmarks: - for (groupName, res) in test.bench(vm, extraVmOpts=vmArgs).items(): - group = results.setdefault(groupName, {}) - group.update(res) - mx.log(json.dumps(results)) - if resultFile: - with open(resultFile, 'w') as f: - f.write(json.dumps(results)) - -def _get_jmh_path(): - path = mx.get_env('JMH_BENCHMARKS', None) - if not path: - probe = join(dirname(_graal_home), 'java-benchmarks') - if exists(probe): - path = probe - - if not path: - mx.abort("Please set the JMH_BENCHMARKS environment variable to point to the java-benchmarks workspace") - if not exists(path): - mx.abort("The directory denoted by the JMH_BENCHMARKS environment variable does not exist: " + path) - return path - -def makejmhdeps(args): - """creates and installs Maven dependencies required by the JMH benchmarks - - The dependencies are specified by files named pom.mxdeps in the - JMH directory tree. Each such file contains a list of dependencies - defined in JSON format. For example: - - '[{"artifactId" : "compiler.test", "groupId" : "com.oracle.graal", "deps" : ["com.oracle.graal.compiler.test"]}]' - - will result in a dependency being installed in the local Maven repository - that can be referenced in a pom.xml file as follows: - - <dependency> - <groupId>com.oracle.graal</groupId> - <artifactId>compiler.test</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency>""" - - parser = ArgumentParser(prog='mx makejmhdeps') - parser.add_argument('-s', '--settings', help='alternative path for Maven user settings file', metavar='<path>') - parser.add_argument('-p', '--permissive', action='store_true', help='issue note instead of error if a Maven dependency cannot be built due to missing projects/libraries') - args = parser.parse_args(args) - - def makejmhdep(artifactId, groupId, deps): - graalSuite = mx.suite("graal") - path = artifactId + '.jar' - if args.permissive: - allDeps = [] - for name in deps: - dist = mx.distribution(name, fatalIfMissing=False) - if dist: - allDeps = allDeps + [d.name for d in dist.sorted_deps(transitive=True)] - else: - if not mx.project(name, fatalIfMissing=False): - if not mx.library(name, fatalIfMissing=False): - mx.log('Skipping dependency ' + groupId + '.' + artifactId + ' as ' + name + ' cannot be resolved') - return - allDeps.append(name) - d = mx.Distribution(graalSuite, name=artifactId, path=path, sourcesPath=path, deps=allDeps, mainClass=None, excludedDependencies=[], distDependencies=[], javaCompliance=None) - d.make_archive() - cmd = ['mvn', 'install:install-file', '-DgroupId=' + groupId, '-DartifactId=' + artifactId, - '-Dversion=1.0-SNAPSHOT', '-Dpackaging=jar', '-Dfile=' + d.path] - if not mx._opts.verbose: - cmd.append('-q') - if args.settings: - cmd = cmd + ['-s', args.settings] - mx.run(cmd) - os.unlink(d.path) - - jmhPath = _get_jmh_path() - for root, _, filenames in os.walk(jmhPath): - for f in [join(root, n) for n in filenames if n == 'pom.mxdeps']: - mx.logv('[processing ' + f + ']') - try: - with open(f) as fp: - for d in json.load(fp): - artifactId = d['artifactId'] - groupId = d['groupId'] - deps = d['deps'] - makejmhdep(artifactId, groupId, deps) - except ValueError as e: - mx.abort('Error parsing {0}:\n{1}'.format(f, e)) - -def buildjmh(args): - """build the JMH benchmarks""" - - parser = ArgumentParser(prog='mx buildjmh') - parser.add_argument('-s', '--settings', help='alternative path for Maven user settings file', metavar='<path>') - parser.add_argument('-c', action='store_true', dest='clean', help='clean before building') - args = parser.parse_args(args) - - jmhPath = _get_jmh_path() - mx.log('JMH benchmarks: ' + jmhPath) - - # Ensure the mx injected dependencies are up to date - makejmhdeps(['-p'] + (['-s', args.settings] if args.settings else [])) - - timestamp = mx.TimeStampFile(join(_graal_home, 'mx', 'jmh', jmhPath.replace(os.sep, '_') + '.timestamp')) - mustBuild = args.clean - if not mustBuild: - try: - hgfiles = [join(jmhPath, f) for f in subprocess.check_output(['hg', '-R', jmhPath, 'locate']).split('\n')] - mustBuild = timestamp.isOlderThan(hgfiles) - except: - # not a Mercurial repository or hg commands are not available. - mustBuild = True - - if mustBuild: - buildOutput = [] - def _redirect(x): - if mx._opts.verbose: - mx.log(x[:-1]) - else: - buildOutput.append(x) - env = os.environ.copy() - env['JAVA_HOME'] = _jdk(vmToCheck='server') - env['MAVEN_OPTS'] = '-server -XX:-UseJVMCIClassLoader' - mx.log("Building benchmarks...") - cmd = ['mvn'] - if args.settings: - cmd = cmd + ['-s', args.settings] - if args.clean: - cmd.append('clean') - cmd.append('package') - retcode = mx.run(cmd, cwd=jmhPath, out=_redirect, env=env, nonZeroIsFatal=False) - if retcode != 0: - mx.log(''.join(buildOutput)) - mx.abort(retcode) - timestamp.touch() - else: - mx.logv('[all Mercurial controlled files in ' + jmhPath + ' are older than ' + timestamp.path + ' - skipping build]') - -def jmh(args): - """run the JMH benchmarks - - This command respects the standard --vm and --vmbuild options - for choosing which VM to run the benchmarks with.""" - if '-h' in args: - mx.help_(['jmh']) - mx.abort(1) - - vmArgs, benchmarksAndJsons = _extract_VM_args(args) - if isJVMCIEnabled(_get_vm()) and '-XX:-UseJVMCIClassLoader' not in vmArgs: - vmArgs = ['-XX:-UseJVMCIClassLoader'] + vmArgs - - benchmarks = [b for b in benchmarksAndJsons if not b.startswith('{')] - jmhArgJsons = [b for b in benchmarksAndJsons if b.startswith('{')] - jmhOutDir = join(_graal_home, 'mx', 'jmh') - if not exists(jmhOutDir): - os.makedirs(jmhOutDir) - jmhOut = join(jmhOutDir, 'jmh.out') - jmhArgs = {'-rff' : jmhOut, '-v' : 'EXTRA' if mx._opts.verbose else 'NORMAL'} - - # e.g. '{"-wi" : 20}' - for j in jmhArgJsons: - try: - for n, v in json.loads(j).iteritems(): - if v is None: - del jmhArgs[n] - else: - jmhArgs[n] = v - except ValueError as e: - mx.abort('error parsing JSON input: {0}\n{1}'.format(j, e)) - - jmhPath = _get_jmh_path() - mx.log('Using benchmarks in ' + jmhPath) - - matchedSuites = set() - numBench = [0] - for micros in os.listdir(jmhPath): - absoluteMicro = os.path.join(jmhPath, micros) - if not os.path.isdir(absoluteMicro): - continue - if not micros.startswith("micros-"): - mx.logv('JMH: ignored ' + absoluteMicro + " because it doesn't start with 'micros-'") - continue - - microJar = os.path.join(absoluteMicro, "target", "microbenchmarks.jar") - if not exists(microJar): - mx.log('Missing ' + microJar + ' - please run "mx buildjmh"') - continue - if benchmarks: - def _addBenchmark(x): - if x.startswith("Benchmark:"): - return - match = False - for b in benchmarks: - match = match or (b in x) - - if match: - numBench[0] += 1 - matchedSuites.add(micros) - - mx.run_java(['-jar', microJar, "-l"], cwd=jmhPath, out=_addBenchmark, addDefaultArgs=False) - else: - matchedSuites.add(micros) - - mx.logv("matchedSuites: " + str(matchedSuites)) - plural = 's' if not benchmarks or numBench[0] > 1 else '' - number = str(numBench[0]) if benchmarks else "all" - mx.log("Running " + number + " benchmark" + plural + '...') - - regex = [] - if benchmarks: - regex.append(r".*(" + "|".join(benchmarks) + ").*") - - for suite in matchedSuites: - absoluteMicro = os.path.join(jmhPath, suite) - (pfx, exe, vm, forkedVmArgs, _) = _parseVmArgs(vmArgs) - if pfx: - mx.log("JMH ignores prefix: \"" + ' '.join(pfx) + "\"") - javaArgs = ['-jar', os.path.join(absoluteMicro, "target", "microbenchmarks.jar"), - '--jvm', exe, - '--jvmArgs', ' '.join(["-" + vm] + forkedVmArgs)] - for k, v in jmhArgs.iteritems(): - javaArgs.append(k) - if len(str(v)): - javaArgs.append(str(v)) - mx.run_java(javaArgs + regex, addDefaultArgs=False, cwd=jmhPath) - -def specjvm2008(args): - """run one or more SPECjvm2008 benchmarks""" - - def launcher(bm, harnessArgs, extraVmOpts): - return sanitycheck.getSPECjvm2008(harnessArgs + [bm]).bench(_get_vm(), extraVmOpts=extraVmOpts) - - availableBenchmarks = set(sanitycheck.specjvm2008Names) - for name in sanitycheck.specjvm2008Names: - parts = name.rsplit('.', 1) - if len(parts) > 1: - assert len(parts) == 2 - group = parts[0] - availableBenchmarks.add(group) - - _run_benchmark(args, sorted(availableBenchmarks), launcher) - -def specjbb2013(args): - """run the composite SPECjbb2013 benchmark""" - - def launcher(bm, harnessArgs, extraVmOpts): - assert bm is None - return sanitycheck.getSPECjbb2013(harnessArgs).bench(_get_vm(), extraVmOpts=extraVmOpts) - - _run_benchmark(args, None, launcher) - -def specjbb2005(args): - """run the composite SPECjbb2005 benchmark""" - - def launcher(bm, harnessArgs, extraVmOpts): - assert bm is None - return sanitycheck.getSPECjbb2005(harnessArgs).bench(_get_vm(), extraVmOpts=extraVmOpts) - - _run_benchmark(args, None, launcher) - -def hsdis(args, copyToDir=None): - """download the hsdis library - - This is needed to support HotSpot's assembly dumping features. - By default it downloads the Intel syntax version, use the 'att' argument to install AT&T syntax.""" - flavor = 'intel' - if 'att' in args: - flavor = 'att' - if mx.get_arch() == "sparcv9": - flavor = "sparcv9" - lib = mx.add_lib_suffix('hsdis-' + mx.get_arch()) - path = join(_graal_home, 'lib', lib) - - sha1s = { - 'att/hsdis-amd64.dll' : 'bcbd535a9568b5075ab41e96205e26a2bac64f72', - 'att/hsdis-amd64.so' : '58919ba085d4ef7a513f25bae75e7e54ee73c049', - 'intel/hsdis-amd64.dll' : '6a388372cdd5fe905c1a26ced614334e405d1f30', - 'intel/hsdis-amd64.so' : '844ed9ffed64fe9599638f29a8450c50140e3192', - 'intel/hsdis-amd64.dylib' : 'fdb13ef0d7d23d93dacaae9c98837bea0d4fc5a2', - 'sparcv9/hsdis-sparcv9.so': '970640a9af0bd63641f9063c11275b371a59ee60', - } - - flavoredLib = flavor + "/" + lib - if flavoredLib not in sha1s: - mx.logv("hsdis not supported on this plattform or architecture") - return - - if not exists(path): - sha1 = sha1s[flavoredLib] - sha1path = path + '.sha1' - mx.download_file_with_sha1('hsdis', path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavoredLib], sha1, sha1path, True, True, sources=False) - if copyToDir is not None and exists(copyToDir): - shutil.copy(path, copyToDir) - -def hcfdis(args): - """disassemble HexCodeFiles embedded in text files - - Run a tool over the input files to convert all embedded HexCodeFiles - to a disassembled format.""" - - parser = ArgumentParser(prog='mx hcfdis') - parser.add_argument('-m', '--map', help='address to symbol map applied to disassembler output') - parser.add_argument('files', nargs=REMAINDER, metavar='files...') - - args = parser.parse_args(args) - - path = mx.library('HCFDIS').get_path(resolve=True) - mx.run_java(['-cp', path, 'com.oracle.max.hcfdis.HexCodeFileDis'] + args.files) - - if args.map is not None: - addressRE = re.compile(r'0[xX]([A-Fa-f0-9]+)') - with open(args.map) as fp: - lines = fp.read().splitlines() - symbols = dict() - for l in lines: - addressAndSymbol = l.split(' ', 1) - if len(addressAndSymbol) == 2: - address, symbol = addressAndSymbol - if address.startswith('0x'): - address = long(address, 16) - symbols[address] = symbol - for f in args.files: - with open(f) as fp: - lines = fp.read().splitlines() - updated = False - for i in range(0, len(lines)): - l = lines[i] - for m in addressRE.finditer(l): - sval = m.group(0) - val = long(sval, 16) - sym = symbols.get(val) - if sym: - l = l.replace(sval, sym) - updated = True - lines[i] = l - if updated: - mx.log('updating ' + f) - with open('new_' + f, "w") as fp: - for l in lines: - print >> fp, l - -def jacocoreport(args): - """create a JaCoCo coverage report - - Creates the report from the 'jacoco.exec' file in the current directory. - Default output directory is 'coverage', but an alternative can be provided as an argument.""" - jacocoreport = mx.library("JACOCOREPORT", True) - out = 'coverage' - if len(args) == 1: - out = args[0] - elif len(args) > 1: - mx.abort('jacocoreport takes only one argument : an output directory') - - includes = ['com.oracle.graal', 'com.oracle.jvmci'] - for p in mx.projects(): - projsetting = getattr(p, 'jacoco', '') - if projsetting == 'include': - includes.append(p.name) - - includedirs = set() - for p in mx.projects(): - projsetting = getattr(p, 'jacoco', '') - if projsetting == 'exclude': - continue - for include in includes: - if include in p.dir: - includedirs.add(p.dir) - - for i in includedirs: - bindir = i + '/bin' - if not os.path.exists(bindir): - os.makedirs(bindir) - - mx.run_java(['-jar', jacocoreport.get_path(True), '--in', 'jacoco.exec', '--out', out] + sorted(includedirs)) - -def sl(args): - """run an SL program""" - vmArgs, slArgs = _extract_VM_args(args) - vm(vmArgs + ['-cp', mx.classpath(["TRUFFLE", "com.oracle.truffle.sl"]), "com.oracle.truffle.sl.SLLanguage"] + slArgs) - -def sldebug(args): - """run a simple command line debugger for the Simple Language""" - vmArgs, slArgs = _extract_VM_args(args, useDoubleDash=True) - vm(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl.tools"), "com.oracle.truffle.sl.tools.debug.SLREPLServer"] + slArgs) - -def isJVMCIEnabled(vm): - return vm != 'original' and not vm.endswith('nojvmci') - -def jol(args): - """Java Object Layout""" - joljar = mx.library('JOL_INTERNALS').get_path(resolve=True) - candidates = mx.findclass(args, logToConsole=False, matcher=lambda s, classname: s == classname or classname.endswith('.' + s) or classname.endswith('$' + s)) - - if len(candidates) > 0: - candidates = mx.select_items(sorted(candidates)) - else: - # mx.findclass can be mistaken, don't give up yet - candidates = args - - vm(['-javaagent:' + joljar, '-cp', os.pathsep.join([mx.classpath(), joljar]), "org.openjdk.jol.MainObjectInternals"] + candidates) - -def site(args): - """create a website containing javadoc and the project dependency graph""" - - return mx.site(['--name', 'Graal', - '--jd', '@-tag', '--jd', '@test:X', - '--jd', '@-tag', '--jd', '@run:X', - '--jd', '@-tag', '--jd', '@bug:X', - '--jd', '@-tag', '--jd', '@summary:X', - '--jd', '@-tag', '--jd', '@vmoption:X', - '--overview', join(_graal_home, 'graal', 'overview.html'), - '--title', 'Graal OpenJDK Project Documentation', - '--dot-output-base', 'projects'] + args) - -def generateZshCompletion(args): - """generate zsh completion for mx""" - try: - from genzshcomp import CompletionGenerator - except ImportError: - mx.abort("install genzshcomp (pip install genzshcomp)") - - # need to fake module for the custom mx arg parser, otherwise a check in genzshcomp fails - originalModule = mx._argParser.__module__ - mx._argParser.__module__ = "argparse" - generator = CompletionGenerator("mx", mx._argParser) - mx._argParser.__module__ = originalModule - - # strip last line and define local variable "ret" - complt = "\n".join(generator.get().split('\n')[0:-1]).replace('context state line', 'context state line ret=1') - - # add array of possible subcommands (as they are not part of the argument parser) - complt += '\n ": :->command" \\\n' - complt += ' "*::args:->args" && ret=0\n' - complt += '\n' - complt += 'case $state in\n' - complt += '\t(command)\n' - complt += '\t\tlocal -a main_commands\n' - complt += '\t\tmain_commands=(\n' - for cmd in sorted(mx._commands.iterkeys()): - c, _ = mx._commands[cmd][:2] - doc = c.__doc__ - complt += '\t\t\t"{0}'.format(cmd) - if doc: - complt += ':{0}'.format(_fixQuotes(doc.split('\n', 1)[0])) - complt += '"\n' - complt += '\t\t)\n' - complt += '\t\t_describe -t main_commands command main_commands && ret=0\n' - complt += '\t\t;;\n' - - complt += '\t(args)\n' - # TODO: improve matcher: if mx args are given, this doesn't work - complt += '\t\tcase $line[1] in\n' - complt += '\t\t\t(vm | vmg | vmfg | unittest | jmh | dacapo | scaladacapo | specjvm2008 | specjbb2013 | specjbb2005)\n' - complt += '\t\t\t\tnoglob \\\n' - complt += '\t\t\t\t\t_arguments -s -S \\\n' - complt += _appendOptions("jvmci", r"G\:") - # TODO: fix -XX:{-,+}Use* flags - complt += _appendOptions("hotspot", r"XX\:") - complt += '\t\t\t\t\t"-version" && ret=0 \n' - complt += '\t\t\t\t;;\n' - complt += '\t\tesac\n' - complt += '\t\t;;\n' - complt += 'esac\n' - complt += '\n' - complt += 'return $ret' - print complt - -def _fixQuotes(arg): - return arg.replace('\"', '').replace('\'', '').replace('`', '').replace('{', '\\{').replace('}', '\\}').replace('[', '\\[').replace(']', '\\]') - -def _appendOptions(optionType, optionPrefix): - def isBoolean(vmap, field): - return vmap[field] == "Boolean" or vmap[field] == "bool" - - def hasDescription(vmap): - return vmap['optDefault'] or vmap['optDoc'] - - complt = "" - for vmap in _parseVMOptions(optionType): - complt += '\t\t\t\t\t-"' - complt += optionPrefix - if isBoolean(vmap, 'optType'): - complt += '"{-,+}"' - complt += vmap['optName'] - if not isBoolean(vmap, 'optType'): - complt += '=' - if hasDescription(vmap): - complt += "[" - if vmap['optDefault']: - complt += r"(default\: " + vmap['optDefault'] + ")" - if vmap['optDoc']: - complt += _fixQuotes(vmap['optDoc']) - if hasDescription(vmap): - complt += "]" - complt += '" \\\n' - return complt - -def _parseVMOptions(optionType): - parser = OutputParser() - # TODO: the optDoc part can wrapped accross multiple lines, currently only the first line will be captured - # TODO: fix matching for float literals - jvmOptions = re.compile( - r"^[ \t]*" - r"(?P<optType>(Boolean|Integer|Float|Double|String|bool|intx|uintx|ccstr|double)) " - r"(?P<optName>[a-zA-Z0-9]+)" - r"[ \t]+=[ \t]*" - r"(?P<optDefault>([\-0-9]+(\.[0-9]+(\.[0-9]+\.[0-9]+))?|false|true|null|Name|sun\.boot\.class\.path))?" - r"[ \t]*" - r"(?P<optDoc>.+)?", - re.MULTILINE) - parser.addMatcher(ValuesMatcher(jvmOptions, { - 'optType' : '<optType>', - 'optName' : '<optName>', - 'optDefault' : '<optDefault>', - 'optDoc' : '<optDoc>', - })) - - # gather JVMCI options - output = StringIO.StringIO() - vm(['-XX:-BootstrapJVMCI', '-XX:+UnlockDiagnosticVMOptions', '-G:+PrintFlags' if optionType == "jvmci" else '-XX:+PrintFlagsWithComments'], - vm="jvmci", - vmbuild="optimized", - nonZeroIsFatal=False, - out=output.write, - err=subprocess.STDOUT) - - valueMap = parser.parse(output.getvalue()) - return valueMap - -def findbugs(args): - '''run FindBugs against non-test Java projects''' - findBugsHome = mx.get_env('FINDBUGS_HOME', None) - if findBugsHome: - findbugsJar = join(findBugsHome, 'lib', 'findbugs.jar') - else: - findbugsLib = join(_graal_home, 'lib', 'findbugs-3.0.0') - if not exists(findbugsLib): - tmp = tempfile.mkdtemp(prefix='findbugs-download-tmp', dir=_graal_home) - try: - findbugsDist = mx.library('FINDBUGS_DIST').get_path(resolve=True) - with zipfile.ZipFile(findbugsDist) as zf: - candidates = [e for e in zf.namelist() if e.endswith('/lib/findbugs.jar')] - assert len(candidates) == 1, candidates - libDirInZip = os.path.dirname(candidates[0]) - zf.extractall(tmp) - shutil.copytree(join(tmp, libDirInZip), findbugsLib) - finally: - shutil.rmtree(tmp) - findbugsJar = join(findbugsLib, 'findbugs.jar') - assert exists(findbugsJar) - nonTestProjects = [p for p in mx.projects() if not p.name.endswith('.test') and not p.name.endswith('.jtt')] - outputDirs = map(mx._cygpathU2W, [p.output_dir() for p in nonTestProjects]) - javaCompliance = max([p.javaCompliance for p in nonTestProjects]) - findbugsResults = join(_graal_home, 'findbugs.results') - - cmd = ['-jar', mx._cygpathU2W(findbugsJar), '-textui', '-low', '-maxRank', '15'] - if mx.is_interactive(): - cmd.append('-progress') - cmd = cmd + ['-auxclasspath', mx._separatedCygpathU2W(mx.classpath([d.name for d in _jdkDeployedDists] + [p.name for p in nonTestProjects])), '-output', mx._cygpathU2W(findbugsResults), '-exitcode'] + args + outputDirs - exitcode = mx.run_java(cmd, nonZeroIsFatal=False, javaConfig=mx.java(javaCompliance)) - if exitcode != 0: - with open(findbugsResults) as fp: - mx.log(fp.read()) - os.unlink(findbugsResults) - return exitcode - -def checkheaders(args): - """check Java source headers against any required pattern""" - failures = {} - for p in mx.projects(): - if p.native: - continue - - csConfig = join(mx.project(p.checkstyleProj).dir, '.checkstyle_checks.xml') - dom = xml.dom.minidom.parse(csConfig) - for module in dom.getElementsByTagName('module'): - if module.getAttribute('name') == 'RegexpHeader': - for prop in module.getElementsByTagName('property'): - if prop.getAttribute('name') == 'header': - value = prop.getAttribute('value') - matcher = re.compile(value, re.MULTILINE) - for sourceDir in p.source_dirs(): - for root, _, files in os.walk(sourceDir): - for name in files: - if name.endswith('.java') and name != 'package-info.java': - f = join(root, name) - with open(f) as fp: - content = fp.read() - if not matcher.match(content): - failures[f] = csConfig - for n, v in failures.iteritems(): - mx.log('{0}: header does not match RegexpHeader defined in {1}'.format(n, v)) - return len(failures) - -def mx_init(suite): - commands = { - 'build': [build, ''], - 'buildjmh': [buildjmh, '[-options]'], - 'buildvars': [buildvars, ''], - 'buildvms': [buildvms, '[-options]'], - 'c1visualizer' : [c1visualizer, ''], - 'checkheaders': [checkheaders, ''], - 'clean': [clean, ''], - 'ctw': [ctw, '[-vmoptions|noinline|nocomplex|full]'], - 'findbugs': [findbugs, ''], - 'generateZshCompletion' : [generateZshCompletion, ''], - 'hsdis': [hsdis, '[att]'], - 'hcfdis': [hcfdis, ''], - 'igv' : [igv, ''], - 'maven-install-truffle' : [maven_install_truffle, ''], - 'jdkhome': [print_jdkhome, ''], - 'jmh': [jmh, '[VM options] [filters|JMH-args-as-json...]'], - 'dacapo': [dacapo, '[VM options] benchmarks...|"all" [DaCapo options]'], - 'scaladacapo': [scaladacapo, '[VM options] benchmarks...|"all" [Scala DaCapo options]'], - 'specjvm2008': [specjvm2008, '[VM options] benchmarks...|"all" [SPECjvm2008 options]'], - 'specjbb2013': [specjbb2013, '[VM options] [-- [SPECjbb2013 options]]'], - 'specjbb2005': [specjbb2005, '[VM options] [-- [SPECjbb2005 options]]'], - 'gate' : [gate, '[-options]'], - 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], - 'microbench' : [microbench, '[VM options] [-- [JMH options]]'], - 'unittest' : [unittest, '[unittest options] [--] [VM options] [filters...]', _unittestHelpSuffix], - 'makejmhdeps' : [makejmhdeps, ''], - 'shortunittest' : [shortunittest, '[unittest options] [--] [VM options] [filters...]', _unittestHelpSuffix], - 'jacocoreport' : [jacocoreport, '[output directory]'], - 'site' : [site, '[-options]'], - 'vm': [vm, '[-options] class [args...]'], - 'vmg': [vmg, '[-options] class [args...]'], - 'vmfg': [vmfg, '[-options] class [args...]'], - 'deoptalot' : [deoptalot, '[n]'], - 'longtests' : [longtests, ''], - 'sl' : [sl, '[SL args|@VM options]'], - 'sldebug' : [sldebug, '[SL args|@VM options]'], - 'jol' : [jol, ''], - 'makefile' : [mx_graal_makefile.build_makefile, 'build makefiles for JDK build'], - } - - mx.add_argument('--jacoco', help='instruments com.oracle.* classes using JaCoCo', default='off', choices=['off', 'on', 'append']) - mx.add_argument('--vmcwd', dest='vm_cwd', help='current directory will be changed to <path> before the VM is executed', default=None, metavar='<path>') - mx.add_argument('--installed-jdks', help='the base directory in which the JDKs cloned from $JAVA_HOME exist. ' + - 'The VM selected by --vm and --vmbuild options is under this directory (i.e., ' + - join('<path>', '<jdk-version>', '<vmbuild>', 'jre', 'lib', '<vm>', mx.add_lib_prefix(mx.add_lib_suffix('jvm'))) + ')', default=None, metavar='<path>') - - if _vmSourcesAvailable: - mx.add_argument('--vm', action='store', dest='vm', choices=_vmChoices.keys(), help='the VM type to build/run') - mx.add_argument('--vmbuild', action='store', dest='vmbuild', choices=_vmbuildChoices, help='the VM build to build/run (default: ' + _vmbuildChoices[0] + ')') - mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse') - mx.add_argument('--vmprefix', action='store', dest='vm_prefix', help='prefix for running the VM (e.g. "/usr/bin/gdb --args")', metavar='<prefix>') - mx.add_argument('--gdb', action='store_const', const='/usr/bin/gdb --args', dest='vm_prefix', help='alias for --vmprefix "/usr/bin/gdb --args"') - mx.add_argument('--lldb', action='store_const', const='lldb --', dest='vm_prefix', help='alias for --vmprefix "lldb --"') - - commands.update({ - 'export': [export, '[-options] [zipfile]'], - }) - - mx.update_commands(suite, commands) - -def mx_post_parse_cmd_line(opts): # - # TODO _minVersion check could probably be part of a Suite in mx? - def _versionCheck(version): - return version >= _minVersion and (not _untilVersion or version >= _untilVersion) - versionDesc = ">=" + str(_minVersion) - if _untilVersion: - versionDesc += " and <=" + str(_untilVersion) - mx.java(_versionCheck, versionDescription=versionDesc, defaultJdk=True) - - if _vmSourcesAvailable: - if hasattr(opts, 'vm') and opts.vm is not None: - global _vm - _vm = opts.vm - _vm = _vm.replace('graal', 'jvmci') - if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: - global _vmbuild - _vmbuild = opts.vmbuild - global _make_eclipse_launch - _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) - global _jacoco - _jacoco = opts.jacoco - global _vm_cwd - _vm_cwd = opts.vm_cwd - global _installed_jdks - _installed_jdks = opts.installed_jdks - global _vm_prefix - _vm_prefix = opts.vm_prefix - - for jdkDist in _jdkDeployedDists: - def _close(jdkDeployable): - def _install(dist): - assert dist.name == jdkDeployable.name, dist.name + "!=" + jdkDeployable.name - if not jdkDist.partOfHotSpot: - _installDistInJdks(jdkDeployable) - return _install - mx.distribution(jdkDist.name).add_update_listener(_close(jdkDist))
--- a/mx/mx_graal_makefile.py Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,309 +0,0 @@ -# -# ---------------------------------------------------------------------------------------------------- -# -# Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# ---------------------------------------------------------------------------------------------------- -# -import mx, mx_graal, os -from argparse import ArgumentParser, REMAINDER - - -class Makefile: - def __init__(self): - self.rules = [] - self.definitions = [] - - def add_rule(self, s): - self.rules.append(s) - - def add_definition(self, s): - self.definitions.append(s) - - def generate(self): - return "\n\n".join(self.definitions + self.rules) - - -def build_makefile(args): - """Creates a Makefile which is able to build distributions without mx - - The return value indicates how many files were modified""" - parser = ArgumentParser(prog='mx makefile') - parser.add_argument('-o', action='store', dest='output', help='Write contents to this file.') - parser.add_argument('selectedDists', help="Selected distribution names which are going to be built with make.", nargs=REMAINDER) - opts = parser.parse_args(args) - - if opts.selectedDists == None or len(opts.selectedDists) == 0: - opts.selectedDists = [d.name for d in mx_graal._jdkDeployedDists if d.partOfHotSpot] - mf = Makefile() - commandline = " ".join(["mx.sh", "makefile"] + args) - if do_build_makefile(mf, opts.selectedDists, commandline): - contents = mf.generate() - if opts.output == None: - print contents - else: - if mx.update_file(opts.output, contents, showDiff=True): - return 1 - return 0 - -def short_dist_name(name): - return name.replace("COM_ORACLE_", "") - -def filter_projects(deps, t): - def typeFilter(project): # filters - if isinstance(project, str): - project = mx.dependency(project, True) - return isinstance(project, t) - return [d for d in deps if typeFilter(d)] - -def get_jdk_deployed_dists(): - return [d.name for d in mx_graal._jdkDeployedDists] - -def update_list(li, elements): - for e in elements: - if e not in li: - li.append(e) - -def make_dist_rule(dist, mf): - def path_dist_relative(p): - return os.path.relpath(p, dist.suite.dir) - shortName = short_dist_name(dist.name) - jdkDeployedDists = get_jdk_deployed_dists() - jarPath = path_dist_relative(dist.path) - sourcesVariableName = shortName + "_SRC" - depJarVariableName = shortName + "_DEP_JARS" - sources = [] - resources = [] - sortedDeps = dist.sorted_deps(True, transitive=False, includeAnnotationProcessors=True) - projects = filter_projects(sortedDeps, mx.Project) - targetPathPrefix = "$(TARGET)" + os.path.sep - libraryDeps = [path_dist_relative(l.get_path(False)) for l in filter_projects(sortedDeps, mx.Library)] - - annotationProcessorDeps = [] - distDeps = dist.get_dist_deps(includeSelf=False, transitive=True) - distDepProjects = [] - for d in distDeps: - update_list(distDepProjects, d.sorted_deps(includeLibs=False, transitive=True)) - - classPath = [targetPathPrefix + path_dist_relative(d.path) for d in distDeps] + libraryDeps \ - + [path_dist_relative(mx.dependency(name).path) for name in dist.excludedDependencies] - for p in projects: - if p.definedAnnotationProcessors != None and p.definedAnnotationProcessorsDist != dist: - update_list(annotationProcessorDeps, [p]) - for p in projects: - projectDir = path_dist_relative(p.dir) - if p not in distDepProjects and p not in annotationProcessorDeps: - for src in [projectDir + os.path.sep + d for d in p.srcDirs]: - sources.append("$(shell find {} -type f 2> /dev/null)".format(src)) - metaInf = src + os.path.sep + "META-INF" - if os.path.exists(metaInf): - resources.append(metaInf) - - - sourceLines = sourcesVariableName + " = " + ("\n" + sourcesVariableName + " += ").join(sources) - apPaths = [] - apDistNames = [] - apDistVariableNames = [] - for p in annotationProcessorDeps: - apPaths.append(path_dist_relative(p.definedAnnotationProcessorsDist.path)) - name = short_dist_name(p.definedAnnotationProcessorsDist.name) - apDistNames.append(name) - apDistVariableNames.append("$(" + name + "_JAR)") - shouldExport = dist.name in jdkDeployedDists - props = { - "name": shortName, - "jarPath": targetPathPrefix + jarPath, - "depJarsVariableAccess": "$(" + depJarVariableName + ")" if len(classPath) > 0 else "", - "depJarsVariable": depJarVariableName, - "sourceLines": sourceLines, - "sourcesVariableName": sourcesVariableName, - "annotationProcessors": " ".join(apDistVariableNames), - "cpAnnotationProcessors": ":".join(apDistVariableNames), - "jarDeps": " ".join(classPath), - "copyResources": " ".join(resources) - } - - mf.add_definition(sourceLines) - mf.add_definition("{name}_JAR = {jarPath}".format(**props)) - if len(classPath) > 0: mf.add_definition("{depJarsVariable} = {jarDeps}".format(**props)) - if shouldExport: mf.add_definition("EXPORTED_FILES += $({name}_JAR)".format(**props)) - mf.add_rule("""$({name}_JAR): $({sourcesVariableName}) {annotationProcessors} {depJarsVariableAccess} -\t$(call build_and_jar,{cpAnnotationProcessors},$(subst $(space),:,{depJarsVariableAccess}),{copyResources},$({name}_JAR)) -""".format(**props)) - return - - - -def do_build_makefile(mf, selectedDists, commandline): - java = mx.java() - bootClassPath = java.bootclasspath() - bootClassPath = bootClassPath.replace(os.path.realpath(java.jdk), "$(ABS_BOOTDIR)") - jdkBootClassPathVariableName = "JDK_BOOTCLASSPATH" - - mf.add_definition("""# This Makefile is generated automatically, do not edit - -TARGET=. -# Bootstrap JDK to be used (for javac and jar) -ABS_BOOTDIR= - -JAVAC=$(ABS_BOOTDIR)/bin/javac -g -target """ + str(java.javaCompliance) + """ -JAR=$(ABS_BOOTDIR)/bin/jar - -HS_COMMON_SRC=. - -# Directories, where the generated property-files reside within the JAR files -PROVIDERS_INF=/META-INF/jvmci.providers -SERVICES_INF=/META-INF/jvmci.services -OPTIONS_INF=/META-INF/jvmci.options - -JARS = $(foreach dist,$(DISTRIBUTIONS),$($(dist)_JAR)) - -ifeq ($(ABS_BOOTDIR),) - $(error Variable ABS_BOOTDIR must be set to a JDK installation.) -endif -ifeq ($(MAKE_VERBOSE),) - QUIETLY=@ -endif - -# Required to construct a whitespace for use with subst -space := -space += - -# Takes the provider files created by ServiceProviderProcessor (the processor -# for the @ServiceProvider annotation) and merges them into a single file. -# Arguments: -# 1: directory with contents of the JAR file -define process_providers - $(eval providers := $(1)/$(PROVIDERS_INF)) - $(eval services := $(1)/$(SERVICES_INF)) - $(QUIETLY) test -d $(services) || mkdir -p $(services) - $(QUIETLY) test ! -d $(providers) || (cd $(providers) && for i in $$(ls); do c=$$(cat $$i); echo $$i >> $(abspath $(services))/$$c; rm $$i; done) - - @# Since all projects are built together with one javac call we cannot determine - @# which project contains HotSpotVMConfig.inline.hpp so we hardcode it. - $(eval vmconfig := $(1)/hotspot/HotSpotVMConfig.inline.hpp) - $(eval vmconfigDest := $(HS_COMMON_SRC)/../jvmci/com.oracle.jvmci.hotspot/src_gen/hotspot) - $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest)) -endef - -# Reads the files in jvmci.options/ created by OptionProcessor (the processor for the @Option annotation) -# and appends to services/com.oracle.jvmci.options.Options entries for the providers -# also created by the same processor. -# Arguments: -# 1: directory with contents of the JAR file -define process_options - $(eval options := $(1)/$(OPTIONS_INF)) - $(eval services := $(1)/META-INF/services) - $(QUIETLY) test -d $(services) || mkdir -p $(services) - $(QUIETLY) test ! -d $(options) || (cd $(options) && for i in $$(ls); do echo $${i}_Options >> $(abspath $(services))/com.oracle.jvmci.options.Options; done) -endef - -# Extracts META-INF/jvmci.services and META-INF/jvmci.options of a JAR file into a given directory -# Arguments: -# 1: JAR file to extract -# 2: target directory (which already exists) -define extract - $(eval TMP := $(shell mktemp -d $(TARGET)/tmp_XXXXX)) - $(QUIETLY) cd $(TMP) && $(JAR) xf $(abspath $(1)) && \\ - ((test ! -d .$(SERVICES_INF) || cp -r .$(SERVICES_INF) $(abspath $(2))) && \\ - (test ! -d .$(OPTIONS_INF) || cp -r .$(OPTIONS_INF) $(abspath $(2)))); - $(QUIETLY) rm -r $(TMP); - $(QUIETLY) cp $(1) $(2) -endef - -# Calls $(JAVAC) with the boot class path $(JDK_BOOTCLASSPATH) and sources taken from the automatic variable $^ -# Arguments: -# 1: processorpath -# 2: classpath -# 3: resources to copy -# 4: target JAR file -define build_and_jar - $(info Building $(4)) - $(eval TMP := $(shell mkdir -p $(TARGET) && mktemp -d $(TARGET)/tmp_XXXXX)) - $(QUIETLY) $(JAVAC) -d $(TMP) -processorpath :$(1) -bootclasspath $(JDK_BOOTCLASSPATH) -cp :$(2) $(filter %.java,$^) - $(QUIETLY) test "$(3)" = "" || cp -r $(3) $(TMP) - $(QUIETLY) $(call process_options,$(TMP)) - $(QUIETLY) $(call process_providers,$(TMP)) - $(QUIETLY) mkdir -p $(shell dirname $(4)) - $(QUIETLY) $(JAR) -0cf $(4) -C $(TMP) . - $(QUIETLY) rm -r $(TMP) -endef - -# Verifies that make/defs.make contains an appropriate line for each JVMCI service or option -# and that only existing JVMCI services and options are exported. -# Arguments: -# 1: list of service or option files -# 2: variable name for directory of service or option files -define verify_defs_make - $(eval defs := make/defs.make) - $(eval uncondPattern := EXPORT_LIST += $$$$($(2))/) - $(eval condPattern := CONDITIONAL_EXPORT_LIST += $$$$($(2))/) - $(eval unconditionalExports := $(shell grep '^EXPORT_LIST += $$($2)' make/defs.make | sed 's:.*($(2))/::g')) - $(eval conditionalExports := $(shell grep '^CONDITIONAL_EXPORT_LIST += $$($2)' make/defs.make | sed 's:.*($(2))/::g')) - $(eval allExports := $(unconditionalExports) $(conditionalExports)) - $(foreach file,$(1),$(if $(findstring $(file),$(allExports)), ,$(error "Line matching '$(uncondPattern)$(file)' or '$(condPattern)$(file)' not found in $(defs)"))) - $(foreach export,$(unconditionalExports),$(if $(findstring $(export),$(1)), ,$(error "The line '$(uncondPattern)$(export)' should not be in $(defs)"))) -endef - -all: default -\t$(info Put $(EXPORTED_FILES) into SHARED_DIR $(SHARED_DIR)) -\t$(shell mkdir -p $(SHARED_DIR)) -\t$(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(SHARED_DIR))) - -export: all -\t$(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.services/*)),EXPORT_JRE_LIB_JVMCI_SERVICES_DIR) -\t$(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.options/*)),EXPORT_JRE_LIB_JVMCI_OPTIONS_DIR) -.PHONY: export - -clean: -\t$(QUIETLY) rm $(JARS) 2> /dev/null || true -\t$(QUIETLY) rmdir -p $(dir $(JARS)) 2> /dev/null || true -.PHONY: export clean - -""") - s = mx.suite("graal") - dists = [] - ap = [] - projects = [] - for d in s.dists: - if d.name in selectedDists: - update_list(dists, d.get_dist_deps(True, True)) - update_list(projects, d.sorted_deps(includeLibs=False, transitive=True)) - - for p in projects: - deps = p.all_deps([], False, includeSelf=True, includeJreLibs=False, includeAnnotationProcessors=True) - for d in deps: - if d.definedAnnotationProcessorsDist != None: - apd = d.definedAnnotationProcessorsDist - update_list(ap, [apd]) - - if len(dists) > 0: - mf.add_definition(jdkBootClassPathVariableName + " = " + bootClassPath) - for d in ap: make_dist_rule(d, mf) - for d in dists: make_dist_rule(d, mf) - mf.add_definition("DISTRIBUTIONS = " + " ".join([short_dist_name(d.name) for d in dists+ap])) - mf.add_rule("default: $({}_JAR)\n.PHONY: default\n".format("_JAR) $(".join([short_dist_name(d.name) for d in dists]))) - return True - else: - for d in dists: - selectedDists.remove(d.name) - print "Distribution(s) '" + "', '".join(selectedDists) + "' does not exist."
--- a/mx/outputparser.py Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -# ---------------------------------------------------------------------------------------------------- -# -# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# ---------------------------------------------------------------------------------------------------- - -import re - -class OutputParser: - - def __init__(self): - self.matchers = [] - - def addMatcher(self, matcher): - self.matchers.append(matcher) - - def parse(self, output): - valueMaps = [] - for matcher in self.matchers: - matcher.parse(output, valueMaps) - return valueMaps - -""" -Produces a value map for each match of a given regular expression -in some text. The value map is specified by a template map -where each key and value in the template map is either a constant -value or a named group in the regular expression. The latter is -given as the group name enclosed in '<' and '>'. -""" -class ValuesMatcher: - - def __init__(self, regex, valuesTemplate): - assert isinstance(valuesTemplate, dict) - self.regex = regex - self.valuesTemplate = valuesTemplate - - def parse(self, text, valueMaps): - for match in self.regex.finditer(text): - valueMap = {} - for keyTemplate, valueTemplate in self.valuesTemplate.items(): - key = self.get_template_value(match, keyTemplate) - value = self.get_template_value(match, valueTemplate) - assert not valueMap.has_key(key), key - valueMap[key] = value - valueMaps.append(valueMap) - - def get_template_value(self, match, template): - def replace_var(m): - groupName = m.group(1) - return match.group(groupName) - - return re.sub(r'<([\w]+)>', replace_var, template)
--- a/mx/sanitycheck.py Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,435 +0,0 @@ -# ---------------------------------------------------------------------------------------------------- -# -# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# ---------------------------------------------------------------------------------------------------- - -from outputparser import OutputParser, ValuesMatcher -import re, mx, mx_graal, os, sys, StringIO, subprocess -from os.path import isfile, join, exists - -gc = 'UseSerialGC' - -dacapoSanityWarmup = { - 'avrora': [0, 0, 3, 6, 13], - 'batik': [0, 0, 5, 5, 20], - 'eclipse': [0, 0, 0, 0, 0], - 'fop': [4, 8, 10, 20, 30], - 'h2': [0, 0, 5, 5, 8], - 'jython': [0, 0, 5, 10, 13], - 'luindex': [0, 0, 5, 10, 10], - 'lusearch': [0, 4, 5, 5, 8], - 'pmd': [0, 0, 5, 10, 13], - 'sunflow': [0, 2, 5, 10, 15], - 'tomcat': [0, 0, 5, 10, 15], - 'tradebeans': [0, 0, 5, 10, 13], - 'tradesoap': [0, 0, 5, 10, 15], - 'xalan': [0, 0, 5, 10, 18], -} - -dacapoScalaSanityWarmup = { - 'actors': [0, 0, 2, 5, 5], - 'apparat': [0, 0, 2, 5, 5], - 'factorie': [0, 0, 2, 5, 5], - 'kiama': [0, 4, 3, 13, 15], - 'scalac': [0, 0, 5, 15, 20], - 'scaladoc': [0, 0, 5, 15, 15], - 'scalap': [0, 0, 5, 15, 20], - 'scalariform':[0, 0, 6, 15, 20], - 'scalatest': [0, 0, 2, 10, 12], - 'scalaxb': [0, 0, 5, 15, 25], -# (gdub) specs sometimes returns a non-zero value event though there is no apparent failure - 'specs': [0, 0, 0, 0, 0], - 'tmt': [0, 0, 3, 10, 12] -} - -dacapoGateBuildLevels = { - 'avrora': ['product', 'fastdebug', 'debug'], - 'batik': ['product', 'fastdebug', 'debug'], - # (lewurm): does not work with JDK8 - 'eclipse': [], - 'fop': ['fastdebug', 'debug'], - 'h2': ['product', 'fastdebug', 'debug'], - 'jython': ['product', 'fastdebug', 'debug'], - 'luindex': ['product', 'fastdebug', 'debug'], - 'lusearch': ['product'], - 'pmd': ['product', 'fastdebug', 'debug'], - 'sunflow': ['fastdebug', 'debug'], - 'tomcat': ['product', 'fastdebug', 'debug'], - 'tradebeans': ['product', 'fastdebug', 'debug'], - # tradesoap is too unreliable for the gate, often crashing with concurrency problems: - # http://sourceforge.net/p/dacapobench/bugs/99/ - 'tradesoap': [], - 'xalan': ['product', 'fastdebug', 'debug'], -} - -dacapoScalaGateBuildLevels = { - 'actors': ['product', 'fastdebug', 'debug'], - 'apparat': ['product', 'fastdebug', 'debug'], - 'factorie': ['product', 'fastdebug', 'debug'], - 'kiama': ['fastdebug', 'debug'], - 'scalac': ['product', 'fastdebug', 'debug'], - 'scaladoc': ['product', 'fastdebug', 'debug'], - 'scalap': ['product', 'fastdebug', 'debug'], - 'scalariform':['product', 'fastdebug', 'debug'], - 'scalatest': ['product', 'fastdebug', 'debug'], - 'scalaxb': ['product', 'fastdebug', 'debug'], - 'specs': ['product', 'fastdebug', 'debug'], - 'tmt': ['product', 'fastdebug', 'debug'], -} - -specjvm2008Names = [ - 'startup.helloworld', - 'startup.compiler.compiler', - 'startup.compiler.sunflow', - 'startup.compress', - 'startup.crypto.aes', - 'startup.crypto.rsa', - 'startup.crypto.signverify', - 'startup.mpegaudio', - 'startup.scimark.fft', - 'startup.scimark.lu', - 'startup.scimark.monte_carlo', - 'startup.scimark.sor', - 'startup.scimark.sparse', - 'startup.serial', - 'startup.sunflow', - 'startup.xml.transform', - 'startup.xml.validation', - 'compiler.compiler', - 'compiler.sunflow', - 'compress', - 'crypto.aes', - 'crypto.rsa', - 'crypto.signverify', - 'derby', - 'mpegaudio', - 'scimark.fft.large', - 'scimark.lu.large', - 'scimark.sor.large', - 'scimark.sparse.large', - 'scimark.fft.small', - 'scimark.lu.small', - 'scimark.sor.small', - 'scimark.sparse.small', - 'scimark.monte_carlo', - 'serial', - 'sunflow', - 'xml.transform', - 'xml.validation' -] - -def _noneAsEmptyList(a): - if a is None: - return [] - return a - -class SanityCheckLevel: - Fast, Gate, Normal, Extensive, Benchmark = range(5) - -def getSPECjbb2005(benchArgs=None): - benchArgs = [] if benchArgs is None else benchArgs - - specjbb2005 = mx.get_env('SPECJBB2005') - if specjbb2005 is None or not exists(join(specjbb2005, 'jbb.jar')): - mx.abort('Please set the SPECJBB2005 environment variable to a SPECjbb2005 directory') - - score = re.compile(r"^Valid run, Score is (?P<score>[0-9]+)$", re.MULTILINE) - error = re.compile(r"VALIDATION ERROR") - success = re.compile(r"^Valid run, Score is [0-9]+$", re.MULTILINE) - matcher = ValuesMatcher(score, {'group' : 'SPECjbb2005', 'name' : 'score', 'score' : '<score>'}) - classpath = ['jbb.jar', 'check.jar'] - return Test("SPECjbb2005", ['spec.jbb.JBBmain', '-propfile', 'SPECjbb.props'] + benchArgs, [success], [error], [matcher], vmOpts=['-Xms3g', '-XX:+' + gc, '-XX:-UseCompressedOops', '-cp', os.pathsep.join(classpath)], defaultCwd=specjbb2005) - -def getSPECjbb2013(benchArgs=None): - - specjbb2013 = mx.get_env('SPECJBB2013') - if specjbb2013 is None or not exists(join(specjbb2013, 'specjbb2013.jar')): - mx.abort('Please set the SPECJBB2013 environment variable to a SPECjbb2013 directory') - - jops = re.compile(r"^RUN RESULT: hbIR \(max attempted\) = [0-9]+, hbIR \(settled\) = [0-9]+, max-jOPS = (?P<max>[0-9]+), critical-jOPS = (?P<critical>[0-9]+)$", re.MULTILINE) - # error? - success = re.compile(r"org.spec.jbb.controller: Run finished", re.MULTILINE) - matcherMax = ValuesMatcher(jops, {'group' : 'SPECjbb2013', 'name' : 'max', 'score' : '<max>'}) - matcherCritical = ValuesMatcher(jops, {'group' : 'SPECjbb2013', 'name' : 'critical', 'score' : '<critical>'}) - return Test("SPECjbb2013", ['-jar', 'specjbb2013.jar', '-m', 'composite'] + - _noneAsEmptyList(benchArgs), [success], [], [matcherCritical, matcherMax], - vmOpts=['-Xmx6g', '-Xms6g', '-Xmn3g', '-XX:+UseParallelOldGC', '-XX:-UseAdaptiveSizePolicy', '-XX:-UseBiasedLocking', '-XX:-UseCompressedOops'], defaultCwd=specjbb2013) - -def getSPECjvm2008(benchArgs=None): - - specjvm2008 = mx.get_env('SPECJVM2008') - if specjvm2008 is None or not exists(join(specjvm2008, 'SPECjvm2008.jar')): - mx.abort('Please set the SPECJVM2008 environment variable to a SPECjvm2008 directory') - - score = re.compile(r"^(Score on|Noncompliant) (?P<benchmark>[a-zA-Z0-9\._]+)( result)?: (?P<score>[0-9]+((,|\.)[0-9]+)?)( SPECjvm2008 Base)? ops/m$", re.MULTILINE) - error = re.compile(r"^Errors in benchmark: ", re.MULTILINE) - # The ' ops/m' at the end of the success string is important : it's how you can tell valid and invalid runs apart - success = re.compile(r"^(Noncompliant c|C)omposite result: [0-9]+((,|\.)[0-9]+)?( SPECjvm2008 (Base|Peak))? ops/m$", re.MULTILINE) - matcher = ValuesMatcher(score, {'group' : 'SPECjvm2008', 'name' : '<benchmark>', 'score' : '<score>'}) - - return Test("SPECjvm2008", ['-jar', 'SPECjvm2008.jar'] + _noneAsEmptyList(benchArgs), [success], [error], [matcher], vmOpts=['-Xms3g', '-XX:+' + gc, '-XX:-UseCompressedOops'], defaultCwd=specjvm2008) - -def getDacapos(level=SanityCheckLevel.Normal, gateBuildLevel=None, dacapoArgs=None): - checks = [] - - for (bench, ns) in dacapoSanityWarmup.items(): - if ns[level] > 0: - if gateBuildLevel is None or gateBuildLevel in dacapoGateBuildLevels[bench]: - checks.append(getDacapo(bench, ['-n', str(ns[level])] + _noneAsEmptyList(dacapoArgs))) - - return checks - -def getDacapo(name, dacapoArgs=None): - dacapo = mx.get_env('DACAPO_CP') - if dacapo is None: - l = mx.library('DACAPO', False) - if l is not None: - dacapo = l.get_path(True) - else: - mx.abort('DaCapo 9.12 jar file must be specified with DACAPO_CP environment variable or as DACAPO library') - - if not isfile(dacapo) or not dacapo.endswith('.jar'): - mx.abort('Specified DaCapo jar file does not exist or is not a jar file: ' + dacapo) - - dacapoSuccess = re.compile(r"^===== DaCapo 9\.12 ([a-zA-Z0-9_]+) PASSED in ([0-9]+) msec =====", re.MULTILINE) - dacapoFail = re.compile(r"^===== DaCapo 9\.12 ([a-zA-Z0-9_]+) FAILED (warmup|) =====", re.MULTILINE) - dacapoTime = re.compile(r"===== DaCapo 9\.12 (?P<benchmark>[a-zA-Z0-9_]+) PASSED in (?P<time>[0-9]+) msec =====") - dacapoTime1 = re.compile(r"===== DaCapo 9\.12 (?P<benchmark>[a-zA-Z0-9_]+) completed warmup 1 in (?P<time>[0-9]+) msec =====") - - dacapoMatcher = ValuesMatcher(dacapoTime, {'group' : 'DaCapo', 'name' : '<benchmark>', 'score' : '<time>'}) - dacapoMatcher1 = ValuesMatcher(dacapoTime1, {'group' : 'DaCapo-1stRun', 'name' : '<benchmark>', 'score' : '<time>'}) - - # Use ipv4 stack for dacapos; tomcat+solaris+ipv6_interface fails (see also: JDK-8072384) - return Test("DaCapo-" + name, ['-jar', mx._cygpathU2W(dacapo), name] + _noneAsEmptyList(dacapoArgs), [dacapoSuccess], [dacapoFail], [dacapoMatcher, dacapoMatcher1], ['-Xms2g', '-XX:+' + gc, '-XX:-UseCompressedOops', "-Djava.net.preferIPv4Stack=true"]) - -def getScalaDacapos(level=SanityCheckLevel.Normal, gateBuildLevel=None, dacapoArgs=None): - checks = [] - - for (bench, ns) in dacapoScalaSanityWarmup.items(): - if ns[level] > 0: - if gateBuildLevel is None or gateBuildLevel in dacapoScalaGateBuildLevels[bench]: - checks.append(getScalaDacapo(bench, ['-n', str(ns[level])] + _noneAsEmptyList(dacapoArgs))) - - return checks - -def getScalaDacapo(name, dacapoArgs=None): - dacapo = mx.get_env('DACAPO_SCALA_CP') - if dacapo is None: - l = mx.library('DACAPO_SCALA', False) - if l is not None: - dacapo = l.get_path(True) - else: - mx.abort('Scala DaCapo 0.1.0 jar file must be specified with DACAPO_SCALA_CP environment variable or as DACAPO_SCALA library') - - if not isfile(dacapo) or not dacapo.endswith('.jar'): - mx.abort('Specified Scala DaCapo jar file does not exist or is not a jar file: ' + dacapo) - - dacapoSuccess = re.compile(r"^===== DaCapo 0\.1\.0(-SNAPSHOT)? ([a-zA-Z0-9_]+) PASSED in ([0-9]+) msec =====", re.MULTILINE) - dacapoFail = re.compile(r"^===== DaCapo 0\.1\.0(-SNAPSHOT)? ([a-zA-Z0-9_]+) FAILED (warmup|) =====", re.MULTILINE) - dacapoTime = re.compile(r"===== DaCapo 0\.1\.0(-SNAPSHOT)? (?P<benchmark>[a-zA-Z0-9_]+) PASSED in (?P<time>[0-9]+) msec =====") - - dacapoMatcher = ValuesMatcher(dacapoTime, {'group' : "Scala-DaCapo", 'name' : '<benchmark>', 'score' : '<time>'}) - - return Test("Scala-DaCapo-" + name, ['-jar', mx._cygpathU2W(dacapo), name] + _noneAsEmptyList(dacapoArgs), [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:+' + gc, '-XX:-UseCompressedOops']) - -def getBootstraps(): - time = re.compile(r"Bootstrapping Graal\.+ in (?P<time>[0-9]+) ms( \(compiled (?P<methods>[0-9]+) methods\))?") - scoreMatcher = ValuesMatcher(time, {'group' : 'Bootstrap', 'name' : 'BootstrapTime', 'score' : '<time>'}) - methodMatcher = ValuesMatcher(time, {'group' : 'Bootstrap', 'name' : 'BootstrapMethods', 'score' : '<methods>'}) - scoreMatcherBig = ValuesMatcher(time, {'group' : 'Bootstrap-bigHeap', 'name' : 'BootstrapTime', 'score' : '<time>'}) - methodMatcherBig = ValuesMatcher(time, {'group' : 'Bootstrap-bigHeap', 'name' : 'BootstrapMethods', 'score' : '<methods>'}) - - tests = [] - tests.append(Test("Bootstrap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcher, methodMatcher], ignoredVMs=['client', 'server'], benchmarkCompilationRate=False)) - tests.append(Test("Bootstrap-bigHeap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcherBig, methodMatcherBig], vmOpts=['-Xms2g'], ignoredVMs=['client', 'server'], benchmarkCompilationRate=False)) - return tests - -class CTWMode: - Full, NoInline = range(2) - -def getCTW(vm, mode): - time = re.compile(r"CompileTheWorld : Done \([0-9]+ classes, [0-9]+ methods, (?P<time>[0-9]+) ms\)") - scoreMatcher = ValuesMatcher(time, {'group' : 'CompileTheWorld', 'name' : 'CompileTime', 'score' : '<time>'}) - - jre = os.environ.get('JAVA_HOME') - if exists(join(jre, 'jre')): - jre = join(jre, 'jre') - rtjar = join(jre, 'lib', 'rt.jar') - - - args = ['-XX:+CompileTheWorld', '-Xbootclasspath/p:' + rtjar] - if vm == 'jvmci': - args += ['-XX:+BootstrapGraal'] - if mode >= CTWMode.NoInline: - if not mx_graal.isJVMCIEnabled(vm): - args.append('-XX:-Inline') - else: - args.append('-G:CompileTheWordConfig=-Inline') - - return Test("CompileTheWorld", args, successREs=[time], scoreMatchers=[scoreMatcher], benchmarkCompilationRate=False) - - -class Tee: - def __init__(self): - self.output = StringIO.StringIO() - def eat(self, line): - self.output.write(line) - sys.stdout.write(line) - -""" -Encapsulates a single program that is a sanity test and/or a benchmark. -""" -class Test: - def __init__(self, name, cmd, successREs=None, failureREs=None, scoreMatchers=None, vmOpts=None, defaultCwd=None, ignoredVMs=None, benchmarkCompilationRate=False): - - self.name = name - self.successREs = _noneAsEmptyList(successREs) - self.failureREs = _noneAsEmptyList(failureREs) + [re.compile(r"Exception occurred in scope: ")] - self.scoreMatchers = _noneAsEmptyList(scoreMatchers) - self.vmOpts = _noneAsEmptyList(vmOpts) - self.cmd = cmd - self.defaultCwd = defaultCwd - self.ignoredVMs = _noneAsEmptyList(ignoredVMs) - self.benchmarkCompilationRate = benchmarkCompilationRate - if benchmarkCompilationRate: - self.vmOpts = self.vmOpts + ['-XX:+CITime'] - - def __str__(self): - return self.name - - def test(self, vm, cwd=None, extraVmOpts=None, vmbuild=None): - """ - Run this program as a sanity test. - """ - if vm in self.ignoredVMs: - return True - if cwd is None: - cwd = self.defaultCwd - parser = OutputParser() - jvmError = re.compile(r"(?P<jvmerror>([A-Z]:|/).*[/\\]hs_err_pid[0-9]+\.log)") - parser.addMatcher(ValuesMatcher(jvmError, {'jvmError' : '<jvmerror>'})) - - for successRE in self.successREs: - parser.addMatcher(ValuesMatcher(successRE, {'passed' : '1'})) - for failureRE in self.failureREs: - parser.addMatcher(ValuesMatcher(failureRE, {'failed' : '1'})) - - tee = Tee() - retcode = mx_graal.vm(self.vmOpts + _noneAsEmptyList(extraVmOpts) + self.cmd, vm, nonZeroIsFatal=False, out=tee.eat, err=subprocess.STDOUT, cwd=cwd, vmbuild=vmbuild) - output = tee.output.getvalue() - valueMaps = parser.parse(output) - - if len(valueMaps) == 0: - return False - - record = {} - for valueMap in valueMaps: - for key, value in valueMap.items(): - if record.has_key(key) and record[key] != value: - mx.abort('Inconsistant values returned by test machers : ' + str(valueMaps)) - record[key] = value - - jvmErrorFile = record.get('jvmError') - if jvmErrorFile: - mx.log('/!\\JVM Error : dumping error log...') - with open(jvmErrorFile, 'rb') as fp: - mx.log(fp.read()) - os.unlink(jvmErrorFile) - return False - - if record.get('failed') == '1': - return False - - return retcode == 0 and record.get('passed') == '1' - - def bench(self, vm, cwd=None, extraVmOpts=None, vmbuild=None): - """ - Run this program as a benchmark. - """ - if vm in self.ignoredVMs: - return {} - if cwd is None: - cwd = self.defaultCwd - parser = OutputParser() - - for successRE in self.successREs: - parser.addMatcher(ValuesMatcher(successRE, {'passed' : '1'})) - for failureRE in self.failureREs: - parser.addMatcher(ValuesMatcher(failureRE, {'failed' : '1'})) - for scoreMatcher in self.scoreMatchers: - parser.addMatcher(scoreMatcher) - - if self.benchmarkCompilationRate: - if vm == 'jvmci': - bps = re.compile(r"ParsedBytecodesPerSecond@final: (?P<rate>[0-9]+)") - ibps = re.compile(r"InlinedBytecodesPerSecond@final: (?P<rate>[0-9]+)") - parser.addMatcher(ValuesMatcher(bps, {'group' : 'ParsedBytecodesPerSecond', 'name' : self.name, 'score' : '<rate>'})) - parser.addMatcher(ValuesMatcher(ibps, {'group' : 'InlinedBytecodesPerSecond', 'name' : self.name, 'score' : '<rate>'})) - else: - ibps = re.compile(r"(?P<compiler>[\w]+) compilation speed: +(?P<rate>[0-9]+) bytes/s {standard") - parser.addMatcher(ValuesMatcher(ibps, {'group' : 'InlinedBytecodesPerSecond', 'name' : '<compiler>:' + self.name, 'score' : '<rate>'})) - - startDelim = 'START: ' + self.name - endDelim = 'END: ' + self.name - - outputfile = os.environ.get('BENCH_OUTPUT', None) - if outputfile: - # Used only to debug output parsing - with open(outputfile) as fp: - output = fp.read() - start = output.find(startDelim) - end = output.find(endDelim, start) - if start == -1 and end == -1: - return {} - output = output[start + len(startDelim + os.linesep): end] - mx.log(startDelim) - mx.log(output) - mx.log(endDelim) - else: - tee = Tee() - mx.log(startDelim) - if mx_graal.vm(self.vmOpts + _noneAsEmptyList(extraVmOpts) + self.cmd, vm, nonZeroIsFatal=False, out=tee.eat, err=subprocess.STDOUT, cwd=cwd, vmbuild=vmbuild) != 0: - mx.abort("Benchmark failed (non-zero retcode)") - mx.log(endDelim) - output = tee.output.getvalue() - - groups = {} - passed = False - for valueMap in parser.parse(output): - assert (valueMap.has_key('name') and valueMap.has_key('score') and valueMap.has_key('group')) or valueMap.has_key('passed') or valueMap.has_key('failed'), valueMap - if valueMap.get('failed') == '1': - mx.abort("Benchmark failed") - if valueMap.get('passed') == '1': - passed = True - groupName = valueMap.get('group') - if groupName: - group = groups.setdefault(groupName, {}) - name = valueMap.get('name') - score = valueMap.get('score') - if name and score: - group[name] = score - - if not passed: - mx.abort("Benchmark failed (not passed)") - - return groups
--- a/mx/suite.py Fri Jun 19 09:28:25 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1273 +0,0 @@ -suite = { - "mxversion" : "1.0", - "name" : "graal", - "libraries" : { - - # ------------- Libraries ------------- - - "JLINE" : { - "path" : "lib/jline-2.11.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/jline-2.11.jar", - "https://search.maven.org/remotecontent?filepath=jline/jline/2.11/jline-2.11.jar", - ], - "sha1" : "9504d5e2da5d78237239c5226e8200ec21182040", - }, - - "JUNIT" : { - "path" : "lib/junit-4.11.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/junit-4.11.jar", - "https://search.maven.org/remotecontent?filepath=junit/junit/4.11/junit-4.11.jar", - ], - "sha1" : "4e031bb61df09069aeb2bffb4019e7a5034a4ee0", - "eclipse.container" : "org.eclipse.jdt.junit.JUNIT_CONTAINER/4", - "sourcePath" : "lib/junit-4.11-sources.jar", - "sourceUrls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/junit-4.11-sources.jar", - "https://search.maven.org/remotecontent?filepath=junit/junit/4.11/junit-4.11-sources.jar", - ], - "sourceSha1" : "28e0ad201304e4a4abf999ca0570b7cffc352c3c", - "dependencies" : ["HAMCREST"], - }, - - "CHECKSTYLE" : { - "path" : "lib/checkstyle-6.0-all.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/checkstyle-6.0-all.jar", - "jar:http://sourceforge.net/projects/checkstyle/files/checkstyle/6.0/checkstyle-6.0-bin.zip/download!/checkstyle-6.0/checkstyle-6.0-all.jar", - ], - "sha1" : "2bedc7feded58b5fd65595323bfaf7b9bb6a3c7a", - }, - - "HAMCREST" : { - "path" : "lib/hamcrest-core-1.3.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/hamcrest-core-1.3.jar", - "https://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar", - ], - "sha1" : "42a25dc3219429f0e5d060061f71acb49bf010a0", - "sourcePath" : "lib/hamcrest-core-1.3-sources.jar", - "sourceUrls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/hamcrest-core-1.3-sources.jar", - "https://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar", - ], - "sourceSha1" : "1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b", - }, - - "HCFDIS" : { - "path" : "lib/hcfdis-2.jar", - "urls" : ["http://lafo.ssw.uni-linz.ac.at/hcfdis-2.jar"], - "sha1" : "bc8b2253436485e9dbaf81771c259ccfa1a24c80", - }, - - "FINDBUGS_DIST" : { - "path" : "lib/findbugs-dist-3.0.0.zip", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/findbugs-3.0.0.zip", - "http://sourceforge.net/projects/findbugs/files/findbugs/3.0.0/findbugs-3.0.0.zip/download", - ], - "sha1" : "6e56d67f238dbcd60acb88a81655749aa6419c5b", - }, - - "C1VISUALIZER_DIST" : { - "path" : "lib/c1visualizer_2014-04-22.zip", - "urls" : ["https://java.net/downloads/c1visualizer/c1visualizer_2014-04-22.zip"], - "sha1" : "220488d87affb569b893c7201f8ce5d2b0e03141", - }, - - "JOL_INTERNALS" : { - "path" : "lib/jol-internals.jar", - "urls" : ["http://lafo.ssw.uni-linz.ac.at/truffle/jol/jol-internals.jar"], - "sha1" : "508bcd26a4d7c4c44048990c6ea789a3b11a62dc", - }, - - "FINDBUGS" : { - "path" : "jvmci/findbugs-SuppressFBWarnings.jar", - "sha1" : "fb78822d27c68fabf2cb2e5e573b3cdb5f9cae2d", - }, - - "DACAPO" : { - "path" : "lib/dacapo-9.12-bach.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/dacapo-9.12-bach.jar", - "http://softlayer.dl.sourceforge.net/project/dacapobench/9.12-bach/dacapo-9.12-bach.jar", - ], - "sha1" : "2626a9546df09009f6da0df854e6dc1113ef7dd4", - }, - - "JACOCOAGENT" : { - "path" : "lib/jacocoagent.jar", - "urls" : ["http://lafo.ssw.uni-linz.ac.at/jacoco/jacocoagent-0.7.1-1.jar"], - "sha1" : "2f73a645b02e39290e577ce555f00b02004650b0", - }, - - "JACOCOREPORT" : { - "path" : "lib/jacocoreport.jar", - "urls" : ["http://lafo.ssw.uni-linz.ac.at/jacoco/jacocoreport-0.7.1-2.jar"], - "sha1" : "a630436391832d697a12c8f7daef8655d7a1efd2", - }, - - "DACAPO_SCALA" : { - "path" : "lib/dacapo-scala-0.1.0-20120216.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/dacapo-scala-0.1.0-20120216.jar", - "http://repo.scalabench.org/snapshots/org/scalabench/benchmarks/scala-benchmark-suite/0.1.0-SNAPSHOT/scala-benchmark-suite-0.1.0-20120216.103539-3.jar", - ], - "sha1" : "59b64c974662b5cf9dbd3cf9045d293853dd7a51", - }, - - "JAVA_ALLOCATION_INSTRUMENTER" : { - "path" : "lib/java-allocation-instrumenter.jar", - "sourcePath" : "lib/java-allocation-instrumenter.jar", - "urls" : ["http://lafo.ssw.uni-linz.ac.at/java-allocation-instrumenter/java-allocation-instrumenter-8f0db117e64e.jar"], - "sha1" : "476d9a44cd19d6b55f81571077dfa972a4f8a083", - "bootClassPathAgent" : "true", - }, - - "VECMATH" : { - "path" : "lib/vecmath-1.3.1.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/vecmath-1.3.1.jar", - "https://search.maven.org/remotecontent?filepath=java3d/vecmath/1.3.1/vecmath-1.3.1.jar", - ], - "sha1" : "a0ae4f51da409fa0c20fa0ca59e6bbc9413ae71d", - }, - - "JMH" : { - "path" : "lib/jmh-runner-1.4.2.jar", - "sha1" : "f44bffaf237305512002303a306fc5ce3fa63f76", - "urls" : ["http://lafo.ssw.uni-linz.ac.at/jmh/jmh-runner-1.4.2.jar"], - "annotationProcessor" : "true" - }, - - "BATIK" : { - "path" : "lib/batik-all-1.7.jar", - "sha1" : "122b87ca88e41a415cf8b523fd3d03b4325134a3", - "urls" : ["http://lafo.ssw.uni-linz.ac.at/graal-external-deps/batik-all-1.7.jar"], - }, - - # ------------- Truffle ------------- - - "TRUFFLE" : { - "path" : "lib/truffle-0.8-SNAPSHOT.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle/0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-SNAPSHOT/truffle-0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-20150616.114821-1.jar", - ], - "sha1" : "34be0993d8fcaa21129749a329e4bb7841cf27e1", - }, - "TRUFFLE_TCK" : { - "path" : "lib/truffle-tck-0.8-SNAPSHOT.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-tck/0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-SNAPSHOT/truffle-tck-0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-20150616.114824-1.jar", - ], - "sha1" : "e56929575aebba40c5a38f8368826831f79fbff0", - }, - "TRUFFLE_DSL_PROCESSOR" : { - "path" : "lib/truffle-dsl-processor-0.8-SNAPSHOT.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-dsl-processor/0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-SNAPSHOT/truffle-dsl-processor-0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-20150616.114822-1.jar", - ], - "sha1" : "242e4126d9857691386631120e658dbda385f984", - "annotationProcessor" : "true", - "dependencies" : ["TRUFFLE"] - }, - "TRUFFLE_SL" : { - "path" : "lib/truffle-sl-0.8-SNAPSHOT.jar", - "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-sl/0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-SNAPSHOT/truffle-sl-0.8-dd4050aadaf8d91301b159cb30a609d8bb99feeb-20150616.114825-1.jar", - ], - "sha1" : "bf3f09792dc8fab2bd55bf94ddc69859692cbd27", - } - }, - - "jrelibraries" : { - "JFR" : { - "jar" : "jfr.jar", - } - }, - - "projects" : { - - # ------------- JVMCI:Service ------------- - - "com.oracle.jvmci.service" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,JVMCI", - }, - - "com.oracle.jvmci.service.processor" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.service"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Codegen,HotSpot", - }, - - # ------------- JVMCI:API ------------- - - "com.oracle.jvmci.common" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,JVMCI", - }, - - "com.oracle.jvmci.meta" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,JVMCI", - }, - - "com.oracle.jvmci.code" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.meta"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,JVMCI", - }, - - "com.oracle.jvmci.runtime" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.code" - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,JVMCI", - }, - - "com.oracle.jvmci.runtime.test" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "JUNIT", - "com.oracle.jvmci.common", - "com.oracle.jvmci.runtime", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,JVMCI", - }, - - "com.oracle.jvmci.debug" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "dependencies" : [ - "com.oracle.jvmci.options", - "com.oracle.jvmci.code", - "com.oracle.jvmci.service", - ], - "annotationProcessors" : ["com.oracle.jvmci.options.processor"], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Debug", - }, - - "com.oracle.jvmci.debug.test" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "JUNIT", - "com.oracle.jvmci.debug", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Debug,Test", - }, - - "com.oracle.jvmci.options" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - - "com.oracle.jvmci.compiler" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.debug", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.options.processor"], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - - "com.oracle.jvmci.options.processor" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.options", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Codegen", - }, - - "com.oracle.jvmci.options.test" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.options", - "JUNIT", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.options.processor"], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - - # ------------- JVMCI:HotSpot ------------- - - "com.oracle.jvmci.amd64" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.code"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,AMD64", - }, - - "com.oracle.jvmci.sparc" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.code"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,SPARC", - }, - - "com.oracle.jvmci.hotspot" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.hotspotvmconfig", - "FINDBUGS", - "com.oracle.jvmci.runtime", - "com.oracle.jvmci.common", - "com.oracle.jvmci.compiler", - ], - "annotationProcessors" : [ - "com.oracle.jvmci.hotspotvmconfig.processor", - "com.oracle.jvmci.options.processor", - "com.oracle.jvmci.service.processor", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - - "com.oracle.jvmci.hotspotvmconfig" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,HotSpot", - }, - - "com.oracle.jvmci.hotspotvmconfig.processor" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.hotspotvmconfig", "com.oracle.jvmci.common"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,HotSpot,Codegen", - }, - - "com.oracle.jvmci.hotspot.amd64" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.amd64", - "com.oracle.jvmci.hotspot", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,HotSpot,AMD64", - }, - - "com.oracle.jvmci.hotspot.sparc" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.sparc", - "com.oracle.jvmci.hotspot", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,HotSpot,SPARC", - }, - - "com.oracle.jvmci.hotspot.jfr" : { - "subDir" : "jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.hotspot", - "JFR", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "javaCompliance" : "1.8", - "profile" : "", - "workingSets" : "JVMCI,HotSpot", - }, - - # ------------- NFI ------------- - - "com.oracle.nfi" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.7", - }, - - "com.oracle.nfi.test" : { - "subDir" : "graal", - "sourceDirs" : ["test"], - "dependencies" : [ - "com.oracle.nfi", - "com.oracle.jvmci.common", - "JUNIT", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.7", - }, - - # ------------- Graal ------------- - - "com.oracle.graal.code" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.service", - "com.oracle.jvmci.code", - ], - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal", - }, - - "com.oracle.graal.api.collections" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,Graal", - }, - - "com.oracle.graal.api.directives" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,Graal", - }, - - "com.oracle.graal.api.directives.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "dependencies" : [ - "com.oracle.graal.compiler.test", - ], - "javaCompliance" : "1.8", - "workingSets" : "API,Graal", - }, - - "com.oracle.graal.api.runtime" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.service", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,Graal", - }, - - "com.oracle.graal.api.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "JUNIT", - "com.oracle.graal.api.runtime", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,Graal,Test", - }, - - "com.oracle.graal.api.replacements" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.meta"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,Graal,Replacements", - }, - - "com.oracle.graal.hotspot" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.hotspot", - "com.oracle.graal.replacements", - "com.oracle.graal.runtime", - "com.oracle.graal.code", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : [ - "com.oracle.graal.replacements.verifier", - "com.oracle.jvmci.service.processor", - ], - "javaCompliance" : "1.8", - "workingSets" : "Graal,HotSpot", - }, - - "com.oracle.graal.hotspot.amd64" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.hotspot.amd64", - "com.oracle.graal.compiler.amd64", - "com.oracle.graal.hotspot", - "com.oracle.graal.replacements.amd64", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "javaCompliance" : "1.8", - "workingSets" : "Graal,HotSpot,AMD64", - }, - - "com.oracle.graal.hotspot.sparc" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.hotspot", - "com.oracle.jvmci.hotspot.sparc", - "com.oracle.graal.compiler.sparc", - "com.oracle.graal.replacements.sparc", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.service.processor", "com.oracle.graal.compiler.match.processor"], - "javaCompliance" : "1.8", - "workingSets" : "Graal,HotSpot,SPARC", - }, - - "com.oracle.graal.hotspot.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.replacements.test", - "com.oracle.graal.hotspot", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,HotSpot,Test", - }, - - "com.oracle.graal.hotspot.amd64.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.asm.amd64", - "com.oracle.graal.hotspot.test", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,HotSpot,AMD64,Test", - }, - - "com.oracle.graal.nodeinfo" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Graph", - }, - - "com.oracle.graal.nodeinfo.processor" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "dependencies" : [ - "com.oracle.graal.nodeinfo", - ], - "javaCompliance" : "1.8", - "workingSets" : "Graal,Graph", - }, - - "com.oracle.graal.graph" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.nodeinfo", - "com.oracle.graal.compiler.common", - "com.oracle.graal.api.collections", - "com.oracle.graal.api.runtime", - "FINDBUGS", - ], - "javaCompliance" : "1.8", - "annotationProcessors" : ["com.oracle.graal.nodeinfo.processor"], - "workingSets" : "Graal,Graph", - }, - - "com.oracle.graal.graph.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "dependencies" : [ - "JUNIT", - "com.oracle.graal.graph", - ], - "javaCompliance" : "1.8", - "workingSets" : "Graal,Graph,Test", - }, - - "com.oracle.graal.asm" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.code"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Assembler", - }, - - "com.oracle.graal.asm.amd64" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.asm", - "com.oracle.jvmci.amd64", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Assembler,AMD64", - }, - - "com.oracle.graal.asm.sparc" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.asm", - "com.oracle.jvmci.sparc", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Assembler,SPARC", - }, - - "com.oracle.graal.bytecode" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Java", - }, - - "com.oracle.graal.asm.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.code", - "com.oracle.graal.test", - "com.oracle.jvmci.runtime", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Assembler,Test", - }, - - "com.oracle.graal.asm.amd64.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.asm.test", - "com.oracle.jvmci.common", - "com.oracle.graal.asm.amd64", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Assembler,AMD64,Test", - }, - - "com.oracle.graal.lir" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.compiler.common", - "com.oracle.graal.asm", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,LIR", - }, - - "com.oracle.graal.lir.jtt" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.jtt", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,LIR", - }, - - "com.oracle.graal.lir.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "JUNIT", - "com.oracle.graal.lir", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,LIR", - }, - - "com.oracle.graal.lir.amd64" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.lir", - "com.oracle.graal.asm.amd64", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,LIR,AMD64", - }, - - "com.oracle.graal.lir.sparc" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.asm.sparc", - "com.oracle.graal.lir", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,LIR,SPARC", - }, - - "com.oracle.graal.word" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.nodes"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,Graal", - }, - - "com.oracle.graal.replacements" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.api.directives", - "com.oracle.graal.java", - "com.oracle.graal.loop", - "com.oracle.graal.word", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "annotationProcessors" : [ - "com.oracle.graal.replacements.verifier", - "com.oracle.jvmci.service.processor", - ], - "workingSets" : "Graal,Replacements", - }, - - "com.oracle.graal.replacements.amd64" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.replacements", - "com.oracle.graal.lir.amd64", - "com.oracle.graal.compiler", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "workingSets" : "Graal,Replacements,AMD64", - }, - - "com.oracle.graal.replacements.sparc" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.replacements", - "com.oracle.graal.compiler", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Replacements,SPARC", - }, - - "com.oracle.graal.replacements.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.compiler.test", - "com.oracle.graal.replacements", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Replacements,Test", - "jacoco" : "exclude", - }, - - "com.oracle.graal.replacements.verifier" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.api.replacements", - "com.oracle.graal.graph", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Replacements", - }, - - "com.oracle.graal.nodes" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.graph", - "com.oracle.graal.api.replacements", - "com.oracle.graal.lir", - "com.oracle.graal.bytecode", - "com.oracle.jvmci.compiler", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "annotationProcessors" : ["com.oracle.graal.replacements.verifier"], - "workingSets" : "Graal,Graph", - }, - - "com.oracle.graal.nodes.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.compiler.test"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Graph", - }, - - "com.oracle.graal.phases" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.nodes"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Phases", - }, - - "com.oracle.graal.phases.common" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.phases"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Phases", - }, - - "com.oracle.graal.phases.common.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.runtime", - "JUNIT", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Test", - }, - - "com.oracle.graal.virtual" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.phases.common"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Phases", - }, - - "com.oracle.graal.virtual.bench" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["JMH"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Bench", - }, - - "com.oracle.graal.loop" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.phases.common"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Phases", - }, - - "com.oracle.graal.compiler" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.virtual", - "com.oracle.graal.loop", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "workingSets" : "Graal", - }, - - "com.oracle.graal.compiler.match.processor" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.compiler", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Codegen", - }, - - "com.oracle.graal.compiler.amd64" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.compiler", - "com.oracle.graal.lir.amd64", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.graal.compiler.match.processor"], - "javaCompliance" : "1.8", - "workingSets" : "Graal,AMD64", - }, - - "com.oracle.graal.compiler.amd64.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.amd64", - "com.oracle.graal.lir.jtt", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,AMD64,Test", - }, - - "com.oracle.graal.compiler.sparc" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.compiler", - "com.oracle.graal.lir.sparc" - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,SPARC", - }, - - "com.oracle.graal.compiler.sparc.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.sparc", - "com.oracle.graal.compiler.test", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,SPARC,Test", - }, - - "com.oracle.graal.runtime" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.compiler"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal", - }, - - "com.oracle.graal.java" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.phases", - "com.oracle.graal.graphbuilderconf", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "javaCompliance" : "1.8", - "workingSets" : "Graal,Java", - }, - - "com.oracle.graal.graphbuilderconf" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.nodes", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Java", - }, - - "com.oracle.graal.compiler.common" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.debug", - "com.oracle.jvmci.common", - ], - "annotationProcessors" : ["com.oracle.jvmci.options.processor"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Java", - }, - - "com.oracle.graal.printer" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.code", - "com.oracle.graal.java", - "com.oracle.graal.compiler", - ], - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Graph", - }, - - "com.oracle.graal.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.debug", - "JUNIT", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Test", - }, - - "com.oracle.graal.compiler.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.api.directives", - "com.oracle.graal.java", - "com.oracle.graal.test", - "com.oracle.graal.runtime", - "JAVA_ALLOCATION_INSTRUMENTER", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Test", - "jacoco" : "exclude", - }, - - "com.oracle.graal.jtt" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.compiler.test", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Test", - "jacoco" : "exclude", - }, - - # ------------- GraalTruffle ------------- - - "com.oracle.truffle.all" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "TRUFFLE", - "TRUFFLE_DSL_PROCESSOR", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.7", - "workingSets" : "Graal,Truffle", - "jacoco" : "exclude", - }, - - "com.oracle.graal.truffle" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "TRUFFLE", - "TRUFFLE_DSL_PROCESSOR", - "com.oracle.graal.runtime", - "com.oracle.graal.replacements", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Truffle", - "jacoco" : "exclude", - }, - - "com.oracle.graal.truffle.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.truffle", - "com.oracle.graal.graph.test", - "com.oracle.graal.compiler.test", - "TRUFFLE_SL", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,Truffle,Test", - "jacoco" : "exclude", - }, - - "com.oracle.graal.truffle.hotspot" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.truffle", - "com.oracle.graal.hotspot", - "com.oracle.nfi", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "workingSets" : "Graal,Truffle", - }, - - "com.oracle.graal.truffle.hotspot.amd64" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.truffle.hotspot", - "com.oracle.graal.hotspot.amd64", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "workingSets" : "Graal,Truffle", - }, - - "com.oracle.graal.truffle.hotspot.sparc" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.graal.truffle.hotspot", - "com.oracle.graal.asm.sparc", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "workingSets" : "Graal,Truffle,SPARC", - } - }, - - "distributions" : { - - # ------------- Distributions ------------- - - "JVMCI_SERVICE" : { - "path" : "build/jvmci-service.jar", - "subDir" : "graal", - "sourcesPath" : "build/jvmci-service.src.zip", - "dependencies" : ["com.oracle.jvmci.service"], - "exclude" : ["FINDBUGS"], - }, - - "JVMCI_API" : { - "path" : "build/jvmci-api.jar", - "subDir" : "graal", - "sourcesPath" : "build/jvmci-api.src.zip", - "dependencies" : [ - "com.oracle.jvmci.runtime", - "com.oracle.jvmci.options", - "com.oracle.jvmci.common", - "com.oracle.jvmci.debug", - ], - "exclude" : ["FINDBUGS"], - "distDependencies" : [ - "JVMCI_SERVICE", - ], - }, - - "JVMCI_HOTSPOT" : { - "path" : "build/jvmci-hotspot.jar", - "subDir" : "graal", - "sourcesPath" : "build/jvmci-hotspot.src.zip", - "dependencies" : [ - "com.oracle.jvmci.hotspot.amd64", - "com.oracle.jvmci.hotspot.sparc", - "com.oracle.jvmci.hotspot.jfr", - ], - "distDependencies" : [ - "JVMCI_API", - ], - }, - - "GRAAL" : { - "path" : "build/graal.jar", - "subDir" : "graal", - "sourcesPath" : "build/graal.src.zip", - "dependencies" : [ - "com.oracle.graal.hotspot.amd64", - "com.oracle.graal.hotspot.sparc", - "com.oracle.graal.hotspot", - "com.oracle.graal.printer", - ], - "exclude" : ["FINDBUGS"], - "distDependencies" : [ - "JVMCI_SERVICE", - "JVMCI_HOTSPOT", - ], - }, - - "TRUFFLE" : { - "path" : "build/truffle.jar", - "subDir" : "graal", - "sourcesPath" : "build/truffle.src.zip", - "javaCompliance" : "1.7", - "dependencies" : [ - "com.oracle.truffle.all", - "com.oracle.nfi", - ], - }, - - "GRAAL_TRUFFLE" : { - "path" : "build/graal-truffle.jar", - "subDir" : "graal", - "sourcesPath" : "build/graal-truffle.src.zip", - "dependencies" : [ - "com.oracle.graal.truffle", - "com.oracle.graal.truffle.hotspot.amd64", - "com.oracle.graal.truffle.hotspot.sparc" - ], - "exclude" : ["FINDBUGS"], - "distDependencies" : [ - "GRAAL", - "TRUFFLE", - ], - }, - }, -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/eclipse-settings/org.eclipse.core.resources.prefs Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/<project>=UTF-8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/eclipse-settings/org.eclipse.jdt.apt.core.prefs Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=true +org.eclipse.jdt.apt.genSrcDir=src_gen +org.eclipse.jdt.apt.reconcileEnabled=true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/eclipse-settings/org.eclipse.jdt.core.prefs Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,417 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=${javaCompliance} +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=${javaCompliance} +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=ignore +org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.source=${javaCompliance} +org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled +org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL +org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=48 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=49 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=48 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=100 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=4 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=200 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=false +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/eclipse-settings/org.eclipse.jdt.ui.prefs Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,123 @@ +cleanup.add_default_serial_version_id=false +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=false +cleanup.add_missing_deprecated_annotations=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=false +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.format_source_code=false +cleanup.make_local_variable_final=false +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=false +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=false +cleanup.remove_trailing_whitespaces=false +cleanup.remove_trailing_whitespaces_all=false +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=false +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=false +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=false +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=false +cleanup.remove_unused_private_types=false +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=false +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=false +cleanup_profile=_CleanUpAgitarTests +cleanup_settings_version=2 +comment_clear_blank_lines=false +comment_format_comments=true +comment_format_header=false +comment_format_html=true +comment_format_source_code=true +comment_indent_parameter_description=true +comment_indent_root_tags=true +comment_line_length=120 +comment_new_line_for_parameter=true +comment_separate_root_tags=true +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_Graal +formatter_settings_version=12 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=0 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=0 +sp_cleanup.add_default_serial_version_id=false +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=false +sp_cleanup.add_missing_deprecated_annotations=false +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=false +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=false +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=false +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=false +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=false +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=false +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=false +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=false +sp_cleanup.remove_unused_private_types=false +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/.checkstyle_checks.xml Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,212 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> + +<!-- + This configuration file was written by the eclipse-cs plugin configuration editor +--> +<!-- + Checkstyle-Configuration: Checks + Description: none +--> +<module name="Checker"> + <property name="severity" value="error"/> + <module name="TreeWalker"> + <property name="tabWidth" value="4"/> + <module name="FileContentsHolder"/> + <module name="JavadocStyle"> + <property name="checkHtml" value="false"/> + </module> + <module name="LocalFinalVariableName"/> + <module name="LocalVariableName"/> + <module name="MemberName"> + <property name="format" value="^(([a-z][a-zA-Z0-9]*$)|(_[A-Z][a-zA-Z0-9]*_[a-z][a-zA-Z0-9]*$))"/> + </module> + <module name="MethodName"/> + <module name="PackageName"/> + <module name="ParameterName"/> + <module name="TypeName"> + <property name="format" value="^[A-Z][_a-zA-Z0-9]*$"/> + </module> + <module name="RedundantImport"/> + <module name="LineLength"> + <property name="max" value="250"/> + </module> + <module name="MethodParamPad"/> + <module name="NoWhitespaceAfter"> + <property name="tokens" value="ARRAY_INIT,BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/> + </module> + <module name="NoWhitespaceBefore"> + <property name="tokens" value="SEMI,DOT,POST_DEC,POST_INC"/> + </module> + <module name="ParenPad"/> + <module name="TypecastParenPad"> + <property name="tokens" value="RPAREN,TYPECAST"/> + </module> + <module name="WhitespaceAfter"/> + <module name="WhitespaceAround"> + <property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/> + </module> + <module name="RedundantModifier"/> + <module name="AvoidNestedBlocks"> + <property name="allowInSwitchCase" value="true"/> + </module> + <module name="EmptyBlock"> + <property name="option" value="text"/> + <property name="tokens" value="LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_IF,LITERAL_TRY,LITERAL_WHILE,STATIC_INIT"/> + </module> + <module name="LeftCurly"/> + <module name="NeedBraces"/> + <module name="RightCurly"/> + <module name="EmptyStatement"/> + <module name="HiddenField"> + <property name="severity" value="ignore"/> + <property name="ignoreConstructorParameter" value="true"/> + <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/> + </module> + <module name="FinalClass"/> + <module name="HideUtilityClassConstructor"> + <property name="severity" value="ignore"/> + <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/> + </module> + <module name="ArrayTypeStyle"/> + <module name="UpperEll"/> + <module name="FallThrough"/> + <module name="FinalLocalVariable"> + <property name="severity" value="ignore"/> + <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/> + </module> + <module name="MultipleVariableDeclarations"/> + <module name="StringLiteralEquality"> + <property name="severity" value="error"/> + </module> + <module name="SuperFinalize"/> + <module name="UnnecessaryParentheses"> + <property name="severity" value="ignore"/> + <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/> + </module> + <module name="Indentation"> + <property name="severity" value="ignore"/> + <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/> + </module> + <module name="StaticVariableName"> + <property name="format" value="^[A-Za-z][a-zA-Z0-9]*$"/> + </module> + <module name="EmptyForInitializerPad"/> + <module name="EmptyForIteratorPad"/> + <module name="ModifierOrder"/> + <module name="DefaultComesLast"/> + <module name="InnerAssignment"> + <property name="severity" value="ignore"/> + <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/> + </module> + <module name="ModifiedControlVariable"/> + <module name="MutableException"> + <property name="severity" value="ignore"/> + <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/> + </module> + <module name="ParameterAssignment"> + <property name="severity" value="ignore"/> + <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/> + </module> + <module name="RegexpSinglelineJava"> + <metadata name="net.sf.eclipsecs.core.comment" value="Illegal trailing whitespace(s) at the end of the line."/> + <property name="format" value="\s$"/> + <property name="message" value="Illegal trailing whitespace(s) at the end of the line."/> + <property name="ignoreComments" value="true"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Checks for trailing spaces at the end of a line"/> + </module> + <module name="RegexpSinglelineJava"> + <metadata name="net.sf.eclipsecs.core.comment" value="illegal space before a comma"/> + <property name="format" value=" ,"/> + <property name="message" value="illegal space before a comma"/> + <property name="ignoreComments" value="true"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Checks for whitespace before a comma."/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.customMessage" value="Illegal whitespace before a comma."/> + </module> + <module name="RegexpSinglelineJava"> + <property name="format" value="[^\x00-\x7F]"/> + <property name="message" value="Only use ASCII characters."/> + </module> + <module name="RegexpSinglelineJava"> + <property name="format" value="new (Hashtable|Vector|Stack|StringBuffer)[^\w]"/> + <property name="message" value="Don't use old synchronized collection classes"/> + </module> + </module> + <module name="RegexpHeader"> + <property name="header" value="/\*\n \* Copyright \(c\) (20[0-9][0-9], )?20[0-9][0-9], Oracle and/or its affiliates. All rights reserved.\n \* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n \*\n \* This code is free software; you can redistribute it and/or modify it\n \* under the terms of the GNU General Public License version 2 only, as\n \* published by the Free Software Foundation.\n \*\n \* This code is distributed in the hope that it will be useful, but WITHOUT\n \* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n \* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n \* version 2 for more details \(a copy is included in the LICENSE file that\n \* accompanied this code\).\n \*\n \* You should have received a copy of the GNU General Public License version\n \* 2 along with this work; if not, write to the Free Software Foundation,\n \* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n \*\n \* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n \* or visit www.oracle.com if you need additional information or have any\n \* questions.\n \*/\n"/> + <property name="fileExtensions" value="java"/> + </module> + <module name="FileTabCharacter"> + <property name="severity" value="error"/> + <property name="fileExtensions" value="java"/> + </module> + <module name="NewlineAtEndOfFile"> + <property name="lineSeparator" value="lf"/> + </module> + <module name="Translation"/> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="Checkstyle: stop constant name check"/> + <property name="onCommentFormat" value="Checkstyle: resume constant name check"/> + <property name="checkFormat" value="ConstantNameCheck"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Allow non-conforming constant names"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="Checkstyle: stop method name check"/> + <property name="onCommentFormat" value="Checkstyle: resume method name check"/> + <property name="checkFormat" value="MethodName"/> + <property name="checkC" value="false"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable method name checks"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="CheckStyle: stop parameter assignment check"/> + <property name="onCommentFormat" value="CheckStyle: resume parameter assignment check"/> + <property name="checkFormat" value="ParameterAssignment"/> + <property name="checkC" value="false"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable Parameter Assignment"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="Checkstyle: stop final variable check"/> + <property name="onCommentFormat" value="Checkstyle: resume final variable check"/> + <property name="checkFormat" value="FinalLocalVariable"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable final variable checks"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="Checkstyle: stop"/> + <property name="onCommentFormat" value="Checkstyle: resume"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable all checks"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="CheckStyle: stop inner assignment check"/> + <property name="onCommentFormat" value="CheckStyle: resume inner assignment check"/> + <property name="checkFormat" value="InnerAssignment"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable inner assignment checks"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="Checkstyle: stop field name check"/> + <property name="onCommentFormat" value="Checkstyle: resume field name check"/> + <property name="checkFormat" value="MemberName"/> + <property name="checkC" value="false"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable field name checks"/> + </module> + <module name="RegexpMultiline"> + <metadata name="net.sf.eclipsecs.core.comment" value="illegal Windows line ending"/> + <property name="format" value="\r\n"/> + <property name="message" value="illegal Windows line ending"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="CheckStyle: stop header check"/> + <property name="onCommentFormat" value="CheckStyle: resume header check"/> + <property name="checkFormat" value=".*Header"/> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Disable header checks"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="CheckStyle: stop line length check"/> + <property name="onCommentFormat" value="CheckStyle: resume line length check"/> + <property name="checkFormat" value="LineLength"/> + </module> + <module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="CheckStyle: start generated"/> + <property name="onCommentFormat" value="CheckStyle: stop generated"/> + <property name="checkFormat" value=".*Name|.*LineLength"/> + </module> +</module>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/AnsiTerminalDecorator.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import org.junit.runner.*; +import org.junit.runner.notification.*; + +/** + * Color support for JUnit test output using ANSI escapes codes. + */ +public class AnsiTerminalDecorator extends MxRunListenerDecorator { + + /** Foreground black. */ + public static final String BLACK = "\u001b[30m"; + /** Foreground red. */ + public static final String RED = "\u001b[31m"; + /** Foreground green. */ + public static final String GREEN = "\u001b[32m"; + /** Foreground yellow. */ + public static final String YELLOW = "\u001b[33m"; + /** Foreground blue. */ + public static final String BLUE = "\u001b[34m"; + /** Foreground magenta. */ + public static final String MAGENTA = "\u001b[35m"; + /** Foreground cyan. */ + public static final String CYAN = "\u001b[36m"; + /** Foreground white. */ + public static final String WHITE = "\u001b[37m"; + + /** Foreground bold black. */ + public static final String BOLD_BLACK = "\u001b[30;1m"; + /** Foreground bold red. */ + public static final String BOLD_RED = "\u001b[31;1m"; + /** Foreground bold green. */ + public static final String BOLD_GREEN = "\u001b[32;1m"; + /** Foreground bold yellow. */ + public static final String BOLD_YELLOW = "\u001b[33;1m"; + /** Foreground bold blue. */ + public static final String BOLD_BLUE = "\u001b[34;1m"; + /** Foreground bold magenta. */ + public static final String BOLD_MAGENTA = "\u001b[35;1m"; + /** Foreground bold cyan. */ + public static final String BOLD_CYAN = "\u001b[36;1m"; + /** Foreground bold white. */ + public static final String BOLD_WHITE = "\u001b[37;1m"; + + /** Background black. */ + public static final String BG_BLACK = "\u001b[40m"; + /** Background red. */ + public static final String BG_RED = "\u001b[41m"; + /** Background green. */ + public static final String BG_GREEN = "\u001b[42m"; + /** Background yellow. */ + public static final String BG_YELLOW = "\u001b[43m"; + /** Background blue. */ + public static final String BG_BLUE = "\u001b[44m"; + /** Background magenta. */ + public static final String BG_MAGENTA = "\u001b[45m"; + /** Background cyan. */ + public static final String BG_CYAN = "\u001b[46m"; + /** Background white. */ + public static final String BG_WHITE = "\u001b[47m"; + + /** Reset. */ + public static final String RESET = "\u001b[0m"; + /** Underline. */ + public static final String UNDERLINED = "\u001b[4m"; + + public AnsiTerminalDecorator(MxRunListener l) { + super(l); + } + + @Override + public void testSucceeded(Description description) { + getWriter().print(GREEN); + super.testSucceeded(description); + getWriter().print(RESET); + } + + @Override + public void testAssumptionFailure(Failure failure) { + getWriter().print(BLUE); + super.testAssumptionFailure(failure); + getWriter().print(RESET); + } + + @Override + public void testFailed(Failure failure) { + getWriter().print(RED); + super.testFailed(failure); + getWriter().print(RESET); + } + + @Override + public void testIgnored(Description description) { + getWriter().print(MAGENTA); + super.testIgnored(description); + getWriter().print(RESET); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/EagerStackTraceDecorator.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import org.junit.runner.notification.*; + +public class EagerStackTraceDecorator extends MxRunListenerDecorator { + + public EagerStackTraceDecorator(MxRunListener l) { + super(l); + } + + @Override + public void testFailed(Failure failure) { + super.testFailed(failure); + failure.getException().printStackTrace(getWriter()); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/GCAfterTestDecorator.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import org.junit.runner.*; + +public class GCAfterTestDecorator extends MxRunListenerDecorator { + + public GCAfterTestDecorator(MxRunListener l) { + super(l); + } + + @Override + public void testFinished(Description description) { + System.gc(); + super.testFinished(description); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/MxJUnitWrapper.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.*; +import java.lang.reflect.Modifier; +import java.nio.file.*; +import java.util.*; + +import junit.runner.*; + +import org.junit.internal.*; +import org.junit.runner.*; +import org.junit.runner.notification.*; +import org.junit.runners.*; +import org.junit.runners.model.*; + +public class MxJUnitWrapper { + + /** + * Run the tests contained in the classes named in the <code>args</code>. A single test method + * can be specified by adding #method after the class name. Only a single test can be run in + * this way. If all tests run successfully, exit with a status of 0. Otherwise exit with a + * status of 1. Write feedback while tests are running and write stack traces for all failed + * tests after the tests all complete. + * + * @param args names of classes in which to find tests to run + */ + public static void main(String... args) { + JUnitSystem system = new RealSystem(); + JUnitCore junitCore = new JUnitCore(); + system.out().println("MxJUnitCore"); + system.out().println("JUnit version " + Version.id()); + List<Class<?>> classes = new ArrayList<>(); + String methodName = null; + List<Failure> missingClasses = new ArrayList<>(); + boolean verbose = false; + boolean enableTiming = false; + boolean failFast = false; + boolean color = false; + boolean eagerStackTrace = false; + boolean gcAfterTest = false; + + String[] expandedArgs = expandArgs(args); + for (int i = 0; i < expandedArgs.length; i++) { + String each = expandedArgs[i]; + if (each.charAt(0) == '-') { + // command line arguments + if (each.contentEquals("-JUnitVerbose")) { + verbose = true; + } else if (each.contentEquals("-JUnitFailFast")) { + failFast = true; + } else if (each.contentEquals("-JUnitEnableTiming")) { + enableTiming = true; + } else if (each.contentEquals("-JUnitColor")) { + color = true; + } else if (each.contentEquals("-JUnitEagerStackTrace")) { + eagerStackTrace = true; + } else if (each.contentEquals("-JUnitGCAfterTest")) { + gcAfterTest = true; + } else { + system.out().println("Unknown command line argument: " + each); + } + + } else { + /* + * Entries of the form class#method are handled specially. Only one can be specified + * on the command line as there's no obvious way to build a runner for multiple + * ones. + */ + if (methodName != null) { + system.out().println("Only a single class and method can be specified: " + each); + System.exit(1); + } else if (each.contains("#")) { + String[] pair = each.split("#"); + if (pair.length != 2) { + system.out().println("Malformed class and method request: " + each); + System.exit(1); + } else if (classes.size() != 0) { + system.out().println("Only a single class and method can be specified: " + each); + System.exit(1); + } else { + methodName = pair[1]; + each = pair[0]; + } + } + try { + Class<?> cls = Class.forName(each, false, MxJUnitWrapper.class.getClassLoader()); + if ((cls.getModifiers() & Modifier.ABSTRACT) == 0) { + classes.add(cls); + } + } catch (ClassNotFoundException e) { + system.out().println("Could not find class: " + each); + Description description = Description.createSuiteDescription(each); + Failure failure = new Failure(description, e); + missingClasses.add(failure); + } + } + } + final TextRunListener textListener; + if (!verbose) { + textListener = new TextRunListener(system); + } else { + textListener = new VerboseTextListener(system); + } + MxRunListener mxListener = textListener; + if (enableTiming) { + mxListener = new TimingDecorator(mxListener); + } + if (color) { + mxListener = new AnsiTerminalDecorator(mxListener); + } + if (eagerStackTrace) { + mxListener = new EagerStackTraceDecorator(mxListener); + } + if (gcAfterTest) { + mxListener = new GCAfterTestDecorator(mxListener); + } + junitCore.addListener(TextRunListener.createRunListener(mxListener)); + Request request; + if (methodName == null) { + request = Request.classes(classes.toArray(new Class[0])); + if (failFast) { + Runner runner = request.getRunner(); + if (runner instanceof ParentRunner) { + ParentRunner<?> parentRunner = (ParentRunner<?>) runner; + parentRunner.setScheduler(new RunnerScheduler() { + public void schedule(Runnable childStatement) { + if (textListener.getLastFailure() == null) { + childStatement.run(); + } + } + + public void finished() { + } + }); + } else { + system.out().println("Unexpected Runner subclass " + runner.getClass().getName() + " - fail fast not supported"); + } + } + } else { + if (failFast) { + system.out().println("Single method selected - fail fast not supported"); + } + request = Request.method(classes.get(0), methodName); + } + Result result = junitCore.run(request); + for (Failure each : missingClasses) { + result.getFailures().add(each); + } + System.exit(result.wasSuccessful() ? 0 : 1); + } + + /** + * Gets the command line for the current process. + * + * @return the command line arguments for the current process or {@code null} if they are not + * available + */ + public static List<String> getProcessCommandLine() { + String processArgsFile = System.getenv().get("MX_SUBPROCESS_COMMAND_FILE"); + if (processArgsFile != null) { + try { + return Files.readAllLines(new File(processArgsFile).toPath()); + } catch (IOException e) { + } + } + return null; + } + + /** + * Expand any arguments starting with @ and return the resulting argument array. + * + * @param args + * @return the expanded argument array + */ + private static String[] expandArgs(String[] args) { + List<String> result = null; + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if (arg.length() > 0 && arg.charAt(0) == '@') { + if (result == null) { + result = new ArrayList<>(); + for (int j = 0; j < i; j++) { + result.add(args[j]); + } + expandArg(arg.substring(1), result); + } + } else if (result != null) { + result.add(arg); + } + } + return result != null ? result.toArray(new String[0]) : args; + } + + /** + * Add each line from {@code filename} to the list {@code args}. + * + * @param filename + * @param args + */ + private static void expandArg(String filename, List<String> args) { + BufferedReader br = null; + try { + br = new BufferedReader(new FileReader(filename)); + + String buf; + while ((buf = br.readLine()) != null) { + args.add(buf); + } + br.close(); + } catch (IOException ioe) { + ioe.printStackTrace(); + System.exit(2); + } finally { + try { + if (br != null) { + br.close(); + } + } catch (IOException ioe) { + ioe.printStackTrace(); + System.exit(3); + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/MxRunListener.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.*; + +import org.junit.internal.*; +import org.junit.runner.*; +import org.junit.runner.notification.*; + +public interface MxRunListener { + + /** + * Called before any tests have been run. + * + * @param description describes the tests to be run + */ + void testRunStarted(Description description); + + /** + * Called when all tests have finished. + * + * @param result the summary of the test run, including all the tests that failed + */ + void testRunFinished(Result result); + + /** + * Called when a test class is about to be started. + * + * @param clazz the test class + */ + void testClassStarted(Class<?> clazz); + + /** + * Called when all tests of a test class have finished. + * + * @param clazz the test class + */ + void testClassFinished(Class<?> clazz); + + /** + * Called when an atomic test is about to be started. This is also called for ignored tests. + * + * @param description the description of the test that is about to be run (generally a class and + * method name) + */ + void testStarted(Description description); + + /** + * Called when an atomic test has finished, whether the test succeeds, fails or is ignored. + * + * @param description the description of the test that just ran + */ + void testFinished(Description description); + + /** + * Called when an atomic test fails. + * + * @param failure describes the test that failed and the exception that was thrown + */ + void testFailed(Failure failure); + + /** + * Called when a test will not be run, generally because a test method is annotated with + * {@link org.junit.Ignore}. + * + * @param description describes the test that will not be run + */ + void testIgnored(Description description); + + /** + * Called when an atomic test succeeds. + * + * @param description describes the test that will not be run + */ + void testSucceeded(Description description); + + /** + * Called when an atomic test flags that it assumes a condition that is false. + * + * @param failure describes the test that failed and the {@link AssumptionViolatedException} + * that was thrown + */ + void testAssumptionFailure(Failure failure); + + /** + * Called after {@link #testClassFinished(Class)}. + */ + void testClassFinishedDelimiter(); + + /** + * Called after {@link #testClassStarted(Class)}. + */ + void testClassStartedDelimiter(); + + /** + * Called after {@link #testStarted(Description)}. + */ + void testStartedDelimiter(); + + /** + * Called after {@link #testFailed(Failure)}. + */ + void testFinishedDelimiter(); + + PrintStream getWriter(); + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/MxRunListenerDecorator.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.*; + +import org.junit.runner.*; +import org.junit.runner.notification.*; + +public class MxRunListenerDecorator implements MxRunListener { + + private final MxRunListener l; + + public MxRunListenerDecorator(MxRunListener l) { + this.l = l; + } + + @Override + public void testRunStarted(Description description) { + l.testRunStarted(description); + } + + @Override + public void testRunFinished(Result result) { + l.testRunFinished(result); + } + + @Override + public void testAssumptionFailure(Failure failure) { + l.testAssumptionFailure(failure); + } + + @Override + public void testIgnored(Description description) { + l.testIgnored(description); + } + + @Override + public void testClassStarted(Class<?> clazz) { + l.testClassStarted(clazz); + } + + @Override + public void testClassFinished(Class<?> clazz) { + l.testClassFinished(clazz); + } + + @Override + public void testStarted(Description description) { + l.testStarted(description); + } + + @Override + public void testFinished(Description description) { + l.testFinished(description); + } + + @Override + public void testFailed(Failure failure) { + l.testFailed(failure); + } + + @Override + public void testSucceeded(Description description) { + l.testSucceeded(description); + } + + @Override + public PrintStream getWriter() { + return l.getWriter(); + } + + public void testClassFinishedDelimiter() { + l.testClassFinishedDelimiter(); + } + + public void testClassStartedDelimiter() { + l.testClassStartedDelimiter(); + } + + public void testStartedDelimiter() { + l.testStartedDelimiter(); + } + + public void testFinishedDelimiter() { + l.testFinishedDelimiter(); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/TextRunListener.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.*; + +import org.junit.internal.*; +import org.junit.runner.*; +import org.junit.runner.notification.*; + +public class TextRunListener implements MxRunListener { + + private final PrintStream fWriter; + protected Failure lastFailure; + + public TextRunListener(JUnitSystem system) { + this(system.out()); + } + + public TextRunListener(PrintStream writer) { + fWriter = writer; + } + + @Override + public PrintStream getWriter() { + return fWriter; + } + + public Failure getLastFailure() { + return lastFailure; + } + + @Override + public void testRunStarted(Description description) { + } + + @Override + public void testRunFinished(Result result) { + } + + @Override + public void testAssumptionFailure(Failure failure) { + } + + @Override + public void testClassStarted(Class<?> clazz) { + } + + @Override + public void testClassFinished(Class<?> clazz) { + } + + @Override + public void testStarted(Description description) { + getWriter().print('.'); + } + + @Override + public void testFinished(Description description) { + } + + @Override + public void testFailed(Failure failure) { + getWriter().print('E'); + lastFailure = failure; + } + + @Override + public void testSucceeded(Description description) { + } + + @Override + public void testIgnored(Description description) { + getWriter().print('I'); + } + + @Override + public void testClassFinishedDelimiter() { + } + + @Override + public void testClassStartedDelimiter() { + } + + @Override + public void testStartedDelimiter() { + } + + @Override + public void testFinishedDelimiter() { + } + + public static RunListener createRunListener(MxRunListener l) { + return new TextListener(l.getWriter()) { + private Class<?> lastClass; + private boolean failed; + + @Override + public final void testStarted(Description description) { + Class<?> currentClass = description.getTestClass(); + if (currentClass != lastClass) { + if (lastClass != null) { + l.testClassFinished(lastClass); + l.testClassFinishedDelimiter(); + } + lastClass = currentClass; + l.testClassStarted(currentClass); + l.testClassStartedDelimiter(); + } + failed = false; + l.testStarted(description); + l.testStartedDelimiter(); + } + + @Override + public final void testFailure(Failure failure) { + failed = true; + l.testFailed(failure); + } + + @Override + public final void testFinished(Description description) { + // we have to do this because there is no callback for successful tests + if (!failed) { + l.testSucceeded(description); + } + l.testFinished(description); + l.testFinishedDelimiter(); + } + + @Override + public void testIgnored(Description description) { + l.testStarted(description); + l.testStartedDelimiter(); + l.testIgnored(description); + l.testFinished(description); + l.testFinishedDelimiter(); + } + + @Override + public void testRunStarted(Description description) { + l.testRunStarted(description); + } + + @Override + public void testRunFinished(Result result) { + if (lastClass != null) { + l.testClassFinished(lastClass); + } + l.testRunFinished(result); + super.testRunFinished(result); + } + + @Override + public void testAssumptionFailure(Failure failure) { + l.testAssumptionFailure(failure); + } + + }; + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/TimingDecorator.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import org.junit.runner.*; + +/** + * Timing support for JUnit test runs. + */ +public class TimingDecorator extends MxRunListenerDecorator { + + private long startTime; + private long classStartTime; + + public TimingDecorator(MxRunListener l) { + super(l); + } + + @Override + public void testClassStarted(Class<?> clazz) { + classStartTime = System.nanoTime(); + super.testClassStarted(clazz); + } + + @Override + public void testClassFinished(Class<?> clazz) { + long totalTime = System.nanoTime() - classStartTime; + super.testClassFinished(clazz); + getWriter().print(' ' + valueToString(totalTime)); + } + + @Override + public void testStarted(Description description) { + startTime = System.nanoTime(); + super.testStarted(description); + } + + @Override + public void testFinished(Description description) { + long totalTime = System.nanoTime() - startTime; + super.testFinished(description); + getWriter().print(" " + valueToString(totalTime)); + } + + private static String valueToString(long value) { + return String.format("%d.%d ms", value / 1000000, (value / 100000) % 10); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/VerboseTextListener.java Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.*; + +import org.junit.internal.*; +import org.junit.runner.*; +import org.junit.runner.notification.*; + +public class VerboseTextListener extends TextRunListener { + + public VerboseTextListener(JUnitSystem system) { + this(system.out()); + } + + public VerboseTextListener(PrintStream writer) { + super(writer); + } + + @Override + public void testClassStarted(Class<?> clazz) { + getWriter().print(clazz.getName() + " started"); + } + + @Override + public void testClassFinished(Class<?> clazz) { + getWriter().print(clazz.getName() + " finished"); + } + + @Override + public void testStarted(Description description) { + getWriter().print(" " + description.getMethodName() + ": "); + } + + @Override + public void testIgnored(Description description) { + getWriter().print("Ignored"); + } + + @Override + public void testSucceeded(Description description) { + getWriter().print("Passed"); + } + + @Override + public void testAssumptionFailure(Failure failure) { + getWriter().printf("(%s) ", failure.getMessage()); + } + + @Override + public void testFailed(Failure failure) { + getWriter().print("FAILED"); + lastFailure = failure; + } + + @Override + public void testClassFinishedDelimiter() { + getWriter().println(); + } + + @Override + public void testClassStartedDelimiter() { + getWriter().println(); + } + + @Override + public void testFinishedDelimiter() { + getWriter().println(); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/mx.mx/suite.py Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,61 @@ +suite = { + "mxversion" : "1.0", + "name" : "mx", + "libraries" : { + + # ------------- Libraries ------------- + + "MX_JUNIT" : { + "path" : "lib/junit-4.11.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/junit-4.11.jar", + "https://search.maven.org/remotecontent?filepath=junit/junit/4.11/junit-4.11.jar", + ], + "sha1" : "4e031bb61df09069aeb2bffb4019e7a5034a4ee0", + "eclipse.container" : "org.eclipse.jdt.junit.JUNIT_CONTAINER/4", + "sourcePath" : "lib/junit-4.11-sources.jar", + "sourceUrls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/junit-4.11-sources.jar", + "https://search.maven.org/remotecontent?filepath=junit/junit/4.11/junit-4.11-sources.jar", + ], + "sourceSha1" : "28e0ad201304e4a4abf999ca0570b7cffc352c3c", + "dependencies" : ["MX_HAMCREST"], + }, + + "MX_CHECKSTYLE" : { + "path" : "lib/checkstyle-6.0-all.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/checkstyle-6.0-all.jar", + "jar:http://sourceforge.net/projects/checkstyle/files/checkstyle/6.0/checkstyle-6.0-bin.zip/download!/checkstyle-6.0/checkstyle-6.0-all.jar", + ], + "sha1" : "2bedc7feded58b5fd65595323bfaf7b9bb6a3c7a", + }, + + "MX_HAMCREST" : { + "path" : "lib/hamcrest-core-1.3.jar", + "urls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/hamcrest-core-1.3.jar", + "https://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar", + ], + "sha1" : "42a25dc3219429f0e5d060061f71acb49bf010a0", + "sourcePath" : "lib/hamcrest-core-1.3-sources.jar", + "sourceUrls" : [ + "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/hamcrest-core-1.3-sources.jar", + "https://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar", + ], + "sourceSha1" : "1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b", + }, + }, + + "projects" : { + + "com.oracle.mxtool.junit" : { + "subDir" : "java", + "sourceDirs" : ["src"], + "dependencies" : [ + "MX_JUNIT", + ], + "javaCompliance" : "1.8", + }, + }, +}
--- a/mxtool/mx.py Fri Jun 19 09:28:25 2015 -0700 +++ b/mxtool/mx.py Fri Jun 19 09:31:51 2015 -0700 @@ -33,7 +33,12 @@ Full documentation can be found at https://wiki.openjdk.java.net/display/Graal/The+mx+Tool """ -import sys, os, errno, time, subprocess, shlex, types, StringIO, zipfile, signal, xml.sax.saxutils, tempfile, fnmatch, platform +import sys +if __name__ == '__main__': + # Rename this module as 'mx' so it is not re-executed when imported by other modules. + sys.modules['mx'] = sys.modules.pop('__main__') + +import os, errno, time, subprocess, shlex, types, StringIO, zipfile, signal, xml.sax.saxutils, tempfile, platform import textwrap import socket import tarfile @@ -42,6 +47,7 @@ import shutil, re, xml.dom.minidom import pipes import difflib +import mx_unittest from collections import Callable from threading import Thread from argparse import ArgumentParser, REMAINDER @@ -99,6 +105,7 @@ _dists = dict() _suites = dict() _annotationProcessors = None +_mx_suite = None _primary_suite_path = None _primary_suite = None _opts = None @@ -452,6 +459,39 @@ if not self.native: cp.append(self.output_dir()) + def eclipse_settings_sources(self): + """ + Gets a dictionary from the name of an Eclipse settings file to + the list of files providing its generated content, in overriding order + (i.e., settings from files later in the list override settings from + files earlier in the list). + """ + if not hasattr(self, '_eclipse_settings'): + esdict = {} + hasAps = self.annotation_processors_path() is not None + # start with the mxtool defaults + defaultEclipseSettingsDir = join(_mx_suite.dir, 'eclipse-settings') + if exists(defaultEclipseSettingsDir): + for name in os.listdir(defaultEclipseSettingsDir): + if isfile(join(defaultEclipseSettingsDir, name)) and name != "org.eclipse.jdt.apt.core.prefs" or hasAps: + esdict[name] = [os.path.abspath(join(defaultEclipseSettingsDir, name))] + + # append suite overrides + eclipseSettingsDir = join(self.suite.mxDir, 'eclipse-settings') + if exists(eclipseSettingsDir): + for name in os.listdir(eclipseSettingsDir): + if isfile(join(eclipseSettingsDir, name)) and name != "org.eclipse.jdt.apt.core.prefs" or hasAps: + esdict.setdefault(name, []).append(os.path.abspath(join(eclipseSettingsDir, name))) + + # check for project overrides + projectSettingsDir = join(self.dir, 'eclipse-settings') + if exists(projectSettingsDir): + for name in os.listdir(projectSettingsDir): + if isfile(join(projectSettingsDir, name)) and name != "org.eclipse.jdt.apt.core.prefs" or hasAps: + esdict.setdefault(name, []).append(os.path.abspath(join(projectSettingsDir, name))) + self._eclipse_settings = esdict + return self._eclipse_settings + def find_classes_with_matching_source_line(self, pkgRoot, function, includeInnerClasses=False): """ Scan the sources of this project for Java source files containing a line for which @@ -1013,12 +1053,12 @@ self.primary = primary self.requiredMxVersion = None self.name = _suitename(mxDir) # validated in _load_projects + _suites[self.name] = self if load: # just check that there are no imports self._load_imports() self._load_env() self._load_commands() - _suites[self.name] = self def __str__(self): return self.name @@ -1039,10 +1079,10 @@ except AssertionError as ae: abort('Exception while parsing "mxversion" in project file: ' + str(ae)) - libsMap = suiteDict['libraries'] - jreLibsMap = suiteDict['jrelibraries'] - projsMap = suiteDict['projects'] - distsMap = suiteDict['distributions'] + libsMap = suiteDict.get('libraries', {}) + jreLibsMap = suiteDict.get('jrelibraries', {}) + projsMap = suiteDict.get('projects', {}) + distsMap = suiteDict.get('distributions', {}) def pop_list(attrs, name, context): v = attrs.pop(name, None) @@ -1179,9 +1219,6 @@ def _load_commands(self): commandsName = self._find_commands(self._commands_name()) - if commandsName is None: - # backwards compatibility - commandsName = self._find_commands('commands') if commandsName is not None: if commandsName in sys.modules: abort(commandsName + '.py in suite ' + self.name + ' duplicates ' + sys.modules[commandsName].__file__) @@ -1708,6 +1745,31 @@ p.all_deps(deps, includeLibs=includeLibs, includeJreLibs=includeJreLibs, includeAnnotationProcessors=includeAnnotationProcessors) return deps +def extract_VM_args(args, useDoubleDash=False, allowClasspath=False): + """ + Partitions 'args' into a leading sequence of HotSpot VM options and the rest. If + 'useDoubleDash' then 'args' is partititioned by the first instance of "--". If + not 'allowClasspath' then mx aborts if "-cp" or "-classpath" is in 'args'. + + """ + for i in range(len(args)): + if useDoubleDash: + if args[i] == '--': + vmArgs = args[:i] + remainder = args[i + 1:] + return vmArgs, remainder + else: + if not args[i].startswith('-'): + if i != 0 and (args[i - 1] == '-cp' or args[i - 1] == '-classpath'): + if not allowClasspath: + abort('Cannot supply explicit class path option') + else: + continue + vmArgs = args[:i] + remainder = args[i:] + return vmArgs, remainder + return args, [] + class ArgParser(ArgumentParser): # Override parent to append the list of available commands def format_help(self): @@ -2057,7 +2119,6 @@ return filtered[0] return None - def run_java(args, nonZeroIsFatal=True, out=None, err=None, cwd=None, addDefaultArgs=True, javaConfig=None): if not javaConfig: javaConfig = java() @@ -2756,9 +2817,9 @@ jdtArgs += processorArgs jdtProperties = join(self.proj.dir, '.settings', 'org.eclipse.jdt.core.prefs') - rootJdtProperties = join(self.proj.suite.mxDir, 'eclipse-settings', 'org.eclipse.jdt.core.prefs') - if not exists(jdtProperties) or os.path.getmtime(jdtProperties) < os.path.getmtime(rootJdtProperties): - # Try to fix a missing properties file by running eclipseinit + jdtPropertiesSources = self.proj.eclipse_settings_sources()['org.eclipse.jdt.core.prefs'] + if not exists(jdtProperties) or os.path.getmtime(jdtProperties) < min(map(os.path.getmtime, jdtPropertiesSources)): + # Try to fix a missing or out of date properties file by running eclipseinit _eclipseinit_project(self.proj) if not exists(jdtProperties): log('JDT properties file {0} not found'.format(jdtProperties)) @@ -3850,7 +3911,7 @@ launchFile = join(eclipseLaunches, name + '.launch') return update_file(launchFile, launch), launchFile -def make_eclipse_launch(javaArgs, jre, name=None, deps=None): +def make_eclipse_launch(suite, javaArgs, jre, name=None, deps=None): """ Creates an Eclipse launch configuration file for running/debugging a Java command. """ @@ -3912,7 +3973,7 @@ launch.close('launchConfiguration') launch = launch.xml(newl='\n', standalone='no') % slm.xml(escape=True, standalone='no') - eclipseLaunches = join('mx', 'eclipse-launches') + eclipseLaunches = join(suite.mxDir, 'eclipse-launches') if not exists(eclipseLaunches): os.makedirs(eclipseLaunches) return update_file(join(eclipseLaunches, name + '.launch'), launch) @@ -3934,12 +3995,11 @@ return False if ide == 'eclipse': - eclipseSettingsDir = join(suite.mxDir, 'eclipse-settings') - if exists(eclipseSettingsDir): - for name in os.listdir(eclipseSettingsDir): - path = join(eclipseSettingsDir, name) - if configZip.isOlderThan(path): - return False + for p in suite.projects: + for _, sources in p.eclipse_settings_sources().iteritems(): + for source in sources: + if configZip.isOlderThan(source): + return False return True def _eclipseinit_project(p, files=None, libFiles=None): @@ -4124,37 +4184,15 @@ if not exists(settingsDir): os.mkdir(settingsDir) - # collect the defaults from mxtool - defaultEclipseSettingsDir = join(dirname(__file__), 'eclipse-settings') - esdict = {} - if exists(defaultEclipseSettingsDir): - for name in os.listdir(defaultEclipseSettingsDir): - if isfile(join(defaultEclipseSettingsDir, name)): - esdict[name] = os.path.abspath(join(defaultEclipseSettingsDir, name)) - - # check for suite overrides - eclipseSettingsDir = join(p.suite.mxDir, 'eclipse-settings') - if exists(eclipseSettingsDir): - for name in os.listdir(eclipseSettingsDir): - if isfile(join(eclipseSettingsDir, name)): - esdict[name] = os.path.abspath(join(eclipseSettingsDir, name)) - - # check for project overrides - projectSettingsDir = join(p.dir, 'eclipse-settings') - if exists(projectSettingsDir): - for name in os.listdir(projectSettingsDir): - if isfile(join(projectSettingsDir, name)): - esdict[name] = os.path.abspath(join(projectSettingsDir, name)) - # copy a possibly modified file to the project's .settings directory - for name, path in esdict.iteritems(): - # ignore this file altogether if this project has no annotation processors - if name == "org.eclipse.jdt.apt.core.prefs" and not processorPath: - continue - - with open(path) as f: - content = f.read() - content = content.replace('${javaCompliance}', str(p.javaCompliance)) + for name, sources in p.eclipse_settings_sources().iteritems(): + out = StringIO.StringIO() + print >> out, '# GENERATED -- DO NOT EDIT' + for source in sources: + print >> out, '# Source:', source + with open(source) as f: + print >> out, f.read() + content = out.getvalue().replace('${javaCompliance}', str(p.javaCompliance)) if processorPath: content = content.replace('org.eclipse.jdt.core.compiler.processAnnotations=disabled', 'org.eclipse.jdt.core.compiler.processAnnotations=enabled') update_file(join(settingsDir, name), content) @@ -5006,18 +5044,18 @@ log('fsckprojects command must be run in an interactive shell') return hg = HgConfig() + projectDirs = [p.dir for suite in suites() for p in suite.projects] + distIdeDirs = [d.get_ide_project_dir() for suite in suites() for d in suite.dists if d.get_ide_project_dir() is not None] for suite in suites(True): - projectDirs = [p.dir for p in suite.projects] - distIdeDirs = [d.get_ide_project_dir() for d in suite.dists if d.get_ide_project_dir() is not None] for dirpath, dirnames, files in os.walk(suite.dir): if dirpath == suite.dir: # no point in traversing .hg, lib, or .workspace dirnames[:] = [d for d in dirnames if d not in ['.hg', 'lib', '.workspace']] elif dirpath in projectDirs: - # don't traverse subdirs of an existing project in this suite + # don't traverse subdirs of an existing project dirnames[:] = [] elif dirpath in distIdeDirs: - # don't traverse subdirs of an existing distributions in this suite + # don't traverse subdirs of an existing distribution dirnames[:] = [] else: projectConfigFiles = frozenset(['.classpath', '.project', 'nbproject']) @@ -5027,7 +5065,7 @@ indicatorsInHg = hg.locate(suite.dir, indicators) # Only proceed if there are indicator files that are not under HG if len(indicators) > len(indicatorsInHg): - if not is_interactive() or ask_yes_no(dirpath + ' looks like a removed project -- delete it', 'n'): + if ask_yes_no(dirpath + ' looks like a removed project -- delete it', 'n'): shutil.rmtree(dirpath) log('Deleted ' + dirpath) @@ -5672,6 +5710,7 @@ 'netbeansinit': [netbeansinit, ''], 'suites': [show_suites, ''], 'projects': [show_projects, ''], + 'unittest' : [mx_unittest.unittest, '[unittest options] [--] [VM options] [filters...]', mx_unittest.unittestHelpSuffix], } _argParser = ArgParser() @@ -5679,11 +5718,9 @@ def _suitename(mxDir): base = os.path.basename(mxDir) parts = base.split('.') - # temporary workaround until mx.graal exists - if len(parts) == 1: - return 'graal' - else: - return parts[1] + assert len(parts) == 2 + assert parts[0] == 'mx' + return parts[1] def _is_suite_dir(d, mxDirName=None): """ @@ -5691,11 +5728,10 @@ If mxDirName is None, matches any suite name, otherwise checks for exactly that suite. """ if os.path.isdir(d): - for f in os.listdir(d): - if (mxDirName == None and (f == 'mx' or fnmatch.fnmatch(f, 'mx.*'))) or f == mxDirName: - mxDir = join(d, f) - if exists(mxDir) and isdir(mxDir) and (exists(join(mxDir, 'suite.py'))): - return mxDir + for f in [mxDirName] if mxDirName else [e for e in os.listdir(d) if e.startswith('mx.')]: + mxDir = join(d, f) + if exists(mxDir) and isdir(mxDir) and (exists(join(mxDir, 'suite.py'))): + return mxDir def _check_primary_suite(): if _primary_suite is None: @@ -5733,6 +5769,11 @@ return _findPrimarySuiteMxDirFrom(dirname(__file__)) def main(): + mxMxDir = _is_suite_dir(dirname(__file__)) + assert mxMxDir + global _mx_suite + _mx_suite = _loadSuite(mxMxDir) + primarySuiteMxDir = _findPrimarySuiteMxDir() if primarySuiteMxDir: global _primary_suite @@ -5791,9 +5832,6 @@ currentUmask = None if __name__ == '__main__': - # rename this module as 'mx' so it is not imported twice by the commands.py modules - sys.modules['mx'] = sys.modules.pop('__main__') - # Capture the current umask since there's no way to query it without mutating it. currentUmask = os.umask(0) os.umask(currentUmask)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mxtool/mx_unittest.py Fri Jun 19 09:31:51 2015 -0700 @@ -0,0 +1,262 @@ +#!/usr/bin/env python2.7 +# +# ---------------------------------------------------------------------------------------------------- +# +# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# ---------------------------------------------------------------------------------------------------- +# + +import mx +import os +import re +import tempfile +import fnmatch +from argparse import ArgumentParser, RawDescriptionHelpFormatter + +def _find_classes_with_annotations(p, pkgRoot, annotations, includeInnerClasses=False): + """ + Scan the sources of project 'p' for Java source files containing a line starting with 'annotation' + (ignoring preceding whitespace) and return the fully qualified class name for each Java + source file matched in a list. + """ + + matches = lambda line: len([a for a in annotations if line == a or line.startswith(a + '(')]) != 0 + return p.find_classes_with_matching_source_line(pkgRoot, matches, includeInnerClasses) + +def _run_tests(args, harness, vmLauncher, annotations, testfile, blacklist, whitelist, regex): + + + vmArgs, tests = mx.extract_VM_args(args) + for t in tests: + if t.startswith('-'): + mx.abort('VM option ' + t + ' must precede ' + tests[0]) + + candidates = {} + for p in mx.projects_opt_limit_to_suites(): + if mx.java().javaCompliance < p.javaCompliance: + continue + for c in _find_classes_with_annotations(p, None, annotations).keys(): + candidates[c] = p + + classes = [] + if len(tests) == 0: + classes = candidates.keys() + projectsCp = mx.classpath([pcp.name for pcp in mx.projects_opt_limit_to_suites() if pcp.javaCompliance <= mx.java().javaCompliance]) + else: + projs = set() + found = False + if len(tests) == 1 and '#' in tests[0]: + words = tests[0].split('#') + if len(words) != 2: + mx.abort("Method specification is class#method: " + tests[0]) + t, method = words + + for c, p in candidates.iteritems(): + # prefer exact matches first + if t == c: + found = True + classes.append(c) + projs.add(p.name) + if not found: + for c, p in candidates.iteritems(): + if t in c: + found = True + classes.append(c) + projs.add(p.name) + if not found: + mx.log('warning: no tests matched by substring "' + t) + elif len(classes) != 1: + mx.abort('More than one test matches substring {0} {1}'.format(t, classes)) + + classes = [c + "#" + method for c in classes] + else: + for t in tests: + if '#' in t: + mx.abort('Method specifications can only be used in a single test: ' + t) + for c, p in candidates.iteritems(): + if t in c: + found = True + classes.append(c) + projs.add(p.name) + if not found: + mx.log('warning: no tests matched by substring "' + t) + projectsCp = mx.classpath(projs) + + if blacklist: + classes = [c for c in classes if not any((glob.match(c) for glob in blacklist))] + + if whitelist: + classes = [c for c in classes if any((glob.match(c) for glob in whitelist))] + + if regex: + classes = [c for c in classes if re.search(regex, c)] + + if len(classes) != 0: + f_testfile = open(testfile, 'w') + for c in classes: + f_testfile.write(c + '\n') + f_testfile.close() + harness(projectsCp, vmLauncher, vmArgs) + +def _unittest(args, annotations, vmLauncher=None, prefixCp="", blacklist=None, whitelist=None, verbose=False, fail_fast=False, enable_timing=False, regex=None, color=False, eager_stacktrace=False, gc_after_test=False): + testfile = os.environ.get('MX_TESTFILE', None) + if testfile is None: + (_, testfile) = tempfile.mkstemp(".testclasses", "mxtool") + os.close(_) + + coreCp = mx.classpath(['com.oracle.mxtool.junit', 'HCFDIS']) + + coreArgs = [] + if verbose: + coreArgs.append('-JUnitVerbose') + if fail_fast: + coreArgs.append('-JUnitFailFast') + if enable_timing: + coreArgs.append('-JUnitEnableTiming') + if color: + coreArgs.append('-JUnitColor') + if eager_stacktrace: + coreArgs.append('-JUnitEagerStackTrace') + if gc_after_test: + coreArgs.append('-JUnitGCAfterTest') + + + def harness(projectsCp, vmLauncher, vmArgs): + prefixArgs = ['-esa', '-ea'] + if gc_after_test: + prefixArgs.append('-XX:-DisableExplicitGC') + with open(testfile) as fp: + testclasses = [l.rstrip() for l in fp.readlines()] + + # Run the VM in a mode where application/test classes can + # access classes normally hidden behind the JVMCI class loader + cp = prefixCp + coreCp + os.pathsep + projectsCp + + # suppress menubar and dock when running on Mac + vmArgs = prefixArgs + ['-Djava.awt.headless=true'] + vmArgs + ['-cp', mx._separatedCygpathU2W(cp)] + mainClass = 'com.oracle.mxtool.junit.MxJUnitWrapper' + # Execute Junit directly when one test is being run. This simplifies + # replaying the VM execution in a native debugger (e.g., gdb). + mainClassArgs = coreArgs + (testclasses if len(testclasses) == 1 else ['@' + mx._cygpathU2W(testfile)]) + + vmLauncher(vmArgs, mainClass, mainClassArgs) + + if vmLauncher is None: + vmLauncher = lambda vmArgs, mainClass, mainClassArgs: mx.run_java(vmArgs + [mainClass] + mainClassArgs) + + try: + _run_tests(args, harness, vmLauncher, annotations, testfile, blacklist, whitelist, regex) + finally: + if os.environ.get('MX_TESTFILE') is None: + os.remove(testfile) + +unittestHelpSuffix = """ + Unittest options: + + --blacklist <file> run all testcases not specified in the blacklist + --whitelist <file> run only testcases which are included + in the given whitelist + --verbose enable verbose JUnit output + --fail-fast stop after first JUnit test class that has a failure + --enable-timing enable JUnit test timing + --regex <regex> run only testcases matching a regular expression + --color enable colors output + --eager-stacktrace print stacktrace eagerly + --gc-after-test force a GC after each test + + To avoid conflicts with VM options '--' can be used as delimiter. + + If filters are supplied, only tests whose fully qualified name + includes a filter as a substring are run. + + For example, this command line: + + mx unittest -G:Dump= -G:MethodFilter=BC_aload.* -G:+PrintCFG BC_aload + + will run all JUnit test classes that contain 'BC_aload' in their + fully qualified name and will pass these options to the VM: + + -G:Dump= -G:MethodFilter=BC_aload.* -G:+PrintCFG + + To get around command line length limitations on some OSes, the + JUnit class names to be executed are written to a file that a + custom JUnit wrapper reads and passes onto JUnit proper. The + MX_TESTFILE environment variable can be set to specify a + file which will not be deleted once the unittests are done + (unlike the temporary file otherwise used). + + As with all other commands, using the global '-v' before 'unittest' + command will cause mx to show the complete command line + it uses to run the VM. +""" + +def unittest(args, vmLauncher=None): + """run the JUnit tests (all testcases)""" + + parser = ArgumentParser(prog='mx unittest', + description='run the JUnit tests', + add_help=False, + formatter_class=RawDescriptionHelpFormatter, + epilog=unittestHelpSuffix, + ) + parser.add_argument('--blacklist', help='run all testcases not specified in <file>', metavar='<file>') + parser.add_argument('--whitelist', help='run testcases specified in <file> only', metavar='<file>') + parser.add_argument('--verbose', help='enable verbose JUnit output', action='store_true') + parser.add_argument('--fail-fast', help='stop after first JUnit test class that has a failure', action='store_true') + parser.add_argument('--enable-timing', help='enable JUnit test timing', action='store_true') + parser.add_argument('--regex', help='run only testcases matching a regular expression', metavar='<regex>') + parser.add_argument('--color', help='enable color output', action='store_true') + parser.add_argument('--eager-stacktrace', help='print stacktrace eagerly', action='store_true') + parser.add_argument('--gc-after-test', help='force a GC after each test', action='store_true') + + ut_args = [] + delimiter = False + # check for delimiter + while len(args) > 0: + arg = args.pop(0) + if arg == '--': + delimiter = True + break + ut_args.append(arg) + + if delimiter: + # all arguments before '--' must be recognized + parsed_args = parser.parse_args(ut_args) + else: + # parse all know arguments + parsed_args, args = parser.parse_known_args(ut_args) + + if parsed_args.whitelist: + try: + with open(parsed_args.whitelist) as fp: + parsed_args.whitelist = [re.compile(fnmatch.translate(l.rstrip())) for l in fp.readlines() if not l.startswith('#')] + except IOError: + mx.log('warning: could not read whitelist: ' + parsed_args.whitelist) + if parsed_args.blacklist: + try: + with open(parsed_args.blacklist) as fp: + parsed_args.blacklist = [re.compile(fnmatch.translate(l.rstrip())) for l in fp.readlines() if not l.startswith('#')] + except IOError: + mx.log('warning: could not read blacklist: ' + parsed_args.blacklist) + + _unittest(args, ['@Test', '@Parameters'], vmLauncher=vmLauncher, **parsed_args.__dict__)
--- a/src/share/vm/jvmci/jvmciCodeInstaller.cpp Fri Jun 19 09:28:25 2015 -0700 +++ b/src/share/vm/jvmci/jvmciCodeInstaller.cpp Fri Jun 19 09:31:51 2015 -0700 @@ -446,6 +446,7 @@ methodHandle method = getMethodFromHotSpotMethod(HotSpotCompiledNmethod::method(compiled_code)); jint entry_bci = HotSpotCompiledNmethod::entryBCI(compiled_code); jint id = HotSpotCompiledNmethod::id(compiled_code); + jboolean has_unsafe_access = HotSpotCompiledNmethod::hasUnsafeAccess(compiled_code); JVMCIEnv* env = (JVMCIEnv*) (address) HotSpotCompiledNmethod::jvmciEnv(compiled_code); if (id == -1) { // Make sure a valid compile_id is associated with every compile @@ -454,7 +455,7 @@ result = JVMCIEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, JVMCICompiler::instance(), _debug_recorder, _dependencies, env, id, - false, _has_wide_vector, installed_code, compiled_code, speculation_log); + (bool) has_unsafe_access, _has_wide_vector, installed_code, compiled_code, speculation_log); cb = nm; }
--- a/src/share/vm/jvmci/jvmciJavaAccess.hpp Fri Jun 19 09:28:25 2015 -0700 +++ b/src/share/vm/jvmci/jvmciJavaAccess.hpp Fri Jun 19 09:31:51 2015 -0700 @@ -92,6 +92,7 @@ int_field(HotSpotCompiledNmethod, entryBCI) \ int_field(HotSpotCompiledNmethod, id) \ long_field(HotSpotCompiledNmethod, jvmciEnv) \ + boolean_field(HotSpotCompiledNmethod, hasUnsafeAccess) \ end_class \ start_class(HotSpotForeignCallTarget) \ long_field(HotSpotForeignCallTarget, address) \