# HG changeset patch # User Tom Rodriguez # Date 1437416488 25200 # Node ID 7abe84b97eaad9d33d0c52ecfe0c54d4c86c6182 # Parent 71a696ca286282d477c4b106539316b008d3873f# Parent 5c350399111efaf482e4aa0b5da34b2c17757d90 Merge diff -r 71a696ca2862 -r 7abe84b97eaa graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Mon Jul 20 11:19:52 2015 -0700 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Mon Jul 20 11:21:28 2015 -0700 @@ -311,8 +311,7 @@ assert sig[0] == GraphBuilderContext.class; assert sig[1] == ResolvedJavaMethod.class; assert sig[2] == InvocationPlugin.Receiver.class; - Class[] sigTail = Arrays.copyOfRange(sig, 3, sig.length); - assert Arrays.asList(sigTail).stream().allMatch(c -> c == ValueNode.class); + assert Arrays.asList(sig).subList(3, sig.length).stream().allMatch(c -> c == ValueNode.class); while (sigs.size() < sig.length - 2) { sigs.add(null); } diff -r 71a696ca2862 -r 7abe84b97eaa graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java --- a/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java Mon Jul 20 11:19:52 2015 -0700 +++ b/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java Mon Jul 20 11:21:28 2015 -0700 @@ -83,11 +83,11 @@ @Test public void runInt() throws Throwable { - runTest("testInt", Integer.MIN_VALUE, supply(() -> new int[3])); + runTest("testInt", Integer.MIN_VALUE, supply(() -> new int[4])); runTest("testInt", -1, supply(() -> new int[4])); - runTest("testInt", 0, supply(() -> new int[3])); - runTest("testInt", 1, supply(() -> new int[3])); - runTest("testInt", Integer.MAX_VALUE, supply(() -> new int[3])); + runTest("testInt", 0, supply(() -> new int[4])); + runTest("testInt", 1, supply(() -> new int[4])); + runTest("testInt", Integer.MAX_VALUE, supply(() -> new int[4])); } /* diff -r 71a696ca2862 -r 7abe84b97eaa graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCLIRInstruction.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCLIRInstruction.java Mon Jul 20 11:19:52 2015 -0700 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCLIRInstruction.java Mon Jul 20 11:21:28 2015 -0700 @@ -101,5 +101,10 @@ return new SizeEstimate(instructionSize, 0); } } + + @Override + public String toString() { + return "SE[i=" + instructionSize + ", c=" + constantSize + "]"; + } } } diff -r 71a696ca2862 -r 7abe84b97eaa graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Mon Jul 20 11:19:52 2015 -0700 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Mon Jul 20 11:21:28 2015 -0700 @@ -635,13 +635,13 @@ JavaConstant constant) { if (constant.isDefaultForKind() || constant.isNull()) { SPARCAddress resultAddress = (SPARCAddress) crb.asAddress(result); - emitStore(g0.asValue(LIRKind.combine(input)), resultAddress, input.getPlatformKind(), delaySlotLir, null, crb, masm); + emitStore(g0.asValue(LIRKind.combine(input)), resultAddress, result.getPlatformKind(), delaySlotLir, null, crb, masm); } else { try (ScratchRegister sc = masm.getScratchRegister()) { Value scratchRegisterValue = sc.getRegister().asValue(LIRKind.combine(constant)); const2reg(crb, masm, scratchRegisterValue, constantTableBase, constant, SPARCDelayedControlTransfer.DUMMY); SPARCAddress resultAddress = (SPARCAddress) crb.asAddress(result); - emitStore(scratchRegisterValue, resultAddress, input.getPlatformKind(), delaySlotLir, null, crb, masm); + emitStore(scratchRegisterValue, resultAddress, result.getPlatformKind(), delaySlotLir, null, crb, masm); } } } diff -r 71a696ca2862 -r 7abe84b97eaa graal/com.oracle.graal.lir/src/com/oracle/graal/lir/dfa/ValueSet.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/dfa/ValueSet.java Mon Jul 20 11:19:52 2015 -0700 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/dfa/ValueSet.java Mon Jul 20 11:21:28 2015 -0700 @@ -150,4 +150,26 @@ public int hashCode() { throw new UnsupportedOperationException(); } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("["); + boolean comma = false; + + for (int i = 0; i < values.length; i++) { + if (values[i] != null) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + + sb.append(i); + sb.append(": "); + sb.append(values[i]); + } + } + sb.append(']'); + return sb.toString(); + } } diff -r 71a696ca2862 -r 7abe84b97eaa graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeValueMap.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeValueMap.java Mon Jul 20 11:19:52 2015 -0700 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeValueMap.java Mon Jul 20 11:21:28 2015 -0700 @@ -30,15 +30,33 @@ public interface NodeValueMap { - Value operand(Node object); + /** + * Returns the operand that has been previously initialized by + * {@link #setResult(ValueNode, Value)} with the result of an instruction. It's a code + * generation error to ask for the operand of ValueNode that doesn't have one yet. + * + * @param node A node that produces a result value. + */ + Value operand(Node node); - boolean hasOperand(Node object); + /** + * @return {@code true} if there is an {@link Value operand} associated with the {@code node} in + * the current block. + */ + boolean hasOperand(Node node); - Value setResult(ValueNode x, Value operand); + /** + * Associates {@code operand} with the {@code node} in the current block. + * + * @return {@code operand} + */ + Value setResult(ValueNode node, Value operand); /** * Gets the the {@link ValueNode} that produced a {@code value}. If the {@code value} is not * associated with a {@link ValueNode} {@code null} is returned. + * + * This method is intended for debugging purposes only. */ ValueNode valueForOperand(Value value); } diff -r 71a696ca2862 -r 7abe84b97eaa graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Mon Jul 20 11:19:52 2015 -0700 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Mon Jul 20 11:21:28 2015 -0700 @@ -455,9 +455,9 @@ inst.forEachState(state -> { if (state.hasDebugInfo()) { DebugInfo di = state.debugInfo(); - stateString.append(debugInfoToString(di.getBytecodePosition(), di.getReferenceMap(), di.getCalleeSaveInfo())); + stateString.append(debugInfoToString(di.getBytecodePosition(), di.getReferenceMap(), state.getLiveBasePointers(), di.getCalleeSaveInfo())); } else { - stateString.append(debugInfoToString(state.topFrame, null, null)); + stateString.append(debugInfoToString(state.topFrame, null, state.getLiveBasePointers(), null)); } }); if (stateString.length() > 0) { diff -r 71a696ca2862 -r 7abe84b97eaa graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CompilationPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CompilationPrinter.java Mon Jul 20 11:19:52 2015 -0700 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CompilationPrinter.java Mon Jul 20 11:21:28 2015 -0700 @@ -29,6 +29,8 @@ import jdk.internal.jvmci.debug.*; import jdk.internal.jvmci.meta.*; +import com.oracle.graal.lir.dfa.*; + /** * Utility for printing compilation related data structures at various compilation phases. The * output format is such that it can then be fed to the { - private final List jars = new ArrayList<>(2); - - public JVMCIJars() { - String classPath = System.getProperty("java.class.path"); - for (String e : classPath.split(File.pathSeparator)) { - if (e.endsWith(File.separatorChar + "graal.jar") || e.endsWith(File.separatorChar + "graal-truffle.jar")) { - try { - jars.add(new ZipFile(e)); - } catch (IOException ioe) { - throw new InternalError(ioe); - } - } - } - if (jars.size() != 2) { - throw new InternalError("Could not find graal.jar or graal-truffle.jar on class path: " + classPath); - } - } - - public Iterator iterator() { - Stream entries = jars.stream().flatMap(ZipFile::stream); - return entries.iterator(); - } - - public InputStream getInputStream(String classFilePath) throws IOException { - for (ZipFile jar : jars) { - ZipEntry entry = jar.getEntry(classFilePath); - if (entry != null) { - return jar.getInputStream(entry); - } - } - return null; - } -} diff -r 71a696ca2862 -r 7abe84b97eaa mx.graal/suite.py --- a/mx.graal/suite.py Mon Jul 20 11:19:52 2015 -0700 +++ b/mx.graal/suite.py Mon Jul 20 11:21:28 2015 -0700 @@ -95,27 +95,27 @@ # ------------- Truffle ------------- "TRUFFLE" : { - "path" : "lib/truffle-0.8-SNAPSHOT.jar", + "path" : "lib/truffle-0.9-SNAPSHOT.jar", "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-api/0.8-397164a68abffa1e934a581ead91cd882eaae954-SNAPSHOT/truffle-api-0.8-397164a68abffa1e934a581ead91cd882eaae954-20150713.145252-1.jar", + "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-api/0.9-5bc7f7b867abc0cc464205d8884d6a20e21c803b-SNAPSHOT/truffle-api-0.9-5bc7f7b867abc0cc464205d8884d6a20e21c803b-20150718.160556-1.jar", ], - "sha1" : "969c49cb04fb7acfbd20892579847ca8d80f4235", + "sha1" : "5b13fb55d78d9bd00efbd9b8ea5583fe32259c4a", }, "TRUFFLE_DSL_PROCESSOR" : { - "path" : "lib/truffle-dsl-processor-0.8-SNAPSHOT.jar", + "path" : "lib/truffle-dsl-processor-0.9-SNAPSHOT.jar", "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-dsl-processor/0.8-397164a68abffa1e934a581ead91cd882eaae954-SNAPSHOT/truffle-dsl-processor-0.8-397164a68abffa1e934a581ead91cd882eaae954-20150713.145255-1.jar" + "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-dsl-processor/0.9-5bc7f7b867abc0cc464205d8884d6a20e21c803b-SNAPSHOT/truffle-dsl-processor-0.9-5bc7f7b867abc0cc464205d8884d6a20e21c803b-20150718.160558-1.jar" ], - "sha1" : "39ddec960e0e463284b1cc6783cda11dcc80f939", + "sha1" : "92e7d01277bad6165d3f263e05215dd3477a20f4", "annotationProcessor" : "true", "dependencies" : ["TRUFFLE"] }, "TRUFFLE_SL" : { - "path" : "lib/truffle-sl-0.8-SNAPSHOT.jar", + "path" : "lib/truffle-sl-0.9-SNAPSHOT.jar", "urls" : [ - "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-sl/0.8-397164a68abffa1e934a581ead91cd882eaae954-SNAPSHOT/truffle-sl-0.8-397164a68abffa1e934a581ead91cd882eaae954-20150713.145259-1.jar", + "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/com/oracle/truffle-sl/0.9-5bc7f7b867abc0cc464205d8884d6a20e21c803b-SNAPSHOT/truffle-sl-0.9-5bc7f7b867abc0cc464205d8884d6a20e21c803b-20150718.160603-1.jar", ], - "sha1" : "9ffddd8f3659955bb34a018a540603c2391d2115", + "sha1" : "3ca368465d187b67cfd84f828fa91b7496b3949f", } }, diff -r 71a696ca2862 -r 7abe84b97eaa mxtool/mx.py --- a/mxtool/mx.py Mon Jul 20 11:19:52 2015 -0700 +++ b/mxtool/mx.py Mon Jul 20 11:21:28 2015 -0700 @@ -647,7 +647,7 @@ return self._annotationProcessors """ - Gets the class path composed of the distribution jars containing the + Gets the class path composed of the distribution jars containing the annotation processors that will be applied when compiling this project. """ def annotation_processors_path(self): @@ -800,7 +800,7 @@ that may use functionality in one JRE (e.g., Oracle JRE) that is not present in another JRE (e.g., OpenJDK). A motivating example is the Java Flight Recorder library -found in the Oracle JRE. +found in the Oracle JRE. """ class JreLibrary(BaseLibrary): def __init__(self, suite, name, jar, optional): diff -r 71a696ca2862 -r 7abe84b97eaa src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Mon Jul 20 11:19:52 2015 -0700 +++ b/src/share/vm/code/nmethod.cpp Mon Jul 20 11:21:28 2015 -0700 @@ -43,6 +43,21 @@ #include "utilities/dtrace.hpp" #include "utilities/events.hpp" #include "utilities/xmlstream.hpp" +#ifdef TARGET_ARCH_x86 +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "nativeInst_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "nativeInst_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif #ifdef SHARK #include "shark/sharkCompiler.hpp" #endif @@ -2610,6 +2625,14 @@ memcpy(scopes_data_begin(), buffer, size); } +// When using JVMCI the address might be off by the size of a call instruction. +bool nmethod::is_deopt_entry(address pc) { + return pc == deopt_handler_begin() +#ifdef JVMCI + || pc == (deopt_handler_begin() + NativeCall::instruction_size) +#endif // JVMCI + ; +} #ifdef ASSERT static PcDesc* linear_search(nmethod* nm, int pc_offset, bool approximate) { diff -r 71a696ca2862 -r 7abe84b97eaa src/share/vm/code/nmethod.hpp --- a/src/share/vm/code/nmethod.hpp Mon Jul 20 11:19:52 2015 -0700 +++ b/src/share/vm/code/nmethod.hpp Mon Jul 20 11:21:28 2015 -0700 @@ -694,24 +694,7 @@ // Deopt // Return true is the PC is one would expect if the frame is being deopted. bool is_deopt_pc (address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); } - - // (thomaswue) When using jvmci, the address might be off by 5 (because this is the size of the call instruction. - // (thomaswue) TODO: Replace this by a more general mechanism. - // (sanzinger) SPARC has another offset, looked for some variable existing in HotSpot which describes this offset, but i have not - // found anything. - bool is_deopt_entry (address pc) { - return pc == deopt_handler_begin() -#ifdef JVMCI - || pc == deopt_handler_begin() + -#ifdef TARGET_ARCH_sparc - 8 -#endif // sparc -#ifdef TARGET_ARCH_x86 - 5 -#endif // x86 -#endif // JVMCI - ; - } + bool is_deopt_entry(address pc); bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); } // Accessor/mutator for the original pc of a frame before a frame was deopted. address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }