# HG changeset patch # User Doug Simon # Date 1448495712 -3600 # Node ID 089d48dfe8ce692d847f96d1725fbc8968d72652 # Parent a19b68d309a260f4f780bda0cca1fd079dff6d3f 8143730 [JVMCI] infopoint recording is too restrictive diff -r a19b68d309a2 -r 089d48dfe8ce graal/com.oracle.graal.code/src/com/oracle/graal/code/HexCodeFile.java --- a/graal/com.oracle.graal.code/src/com/oracle/graal/code/HexCodeFile.java Wed Nov 25 15:32:07 2015 +0100 +++ b/graal/com.oracle.graal.code/src/com/oracle/graal/code/HexCodeFile.java Thu Nov 26 00:55:12 2015 +0100 @@ -122,7 +122,7 @@ * Map from a machine code position to a comment for the operands of the instruction at the * position. */ - public final Map operandComments = new TreeMap<>(); + public final Map> operandComments = new TreeMap<>(); public final byte[] code; @@ -180,8 +180,10 @@ } } - for (Map.Entry e : operandComments.entrySet()) { - ps.printf("OperandComment %d %s %s%n", e.getKey(), e.getValue(), SECTION_DELIM); + for (Map.Entry> e : operandComments.entrySet()) { + for (String c : e.getValue()) { + ps.printf("OperandComment %d %s %s%n", e.getKey(), c, SECTION_DELIM); + } } ps.flush(); } @@ -218,12 +220,15 @@ } /** - * Sets an operand comment for a given position. - * - * @return the previous operand comment for {@code pos} + * Adds an operand comment for a given position. */ - public String addOperandComment(int pos, String comment) { - return operandComments.put(pos, encodeString(comment)); + public void addOperandComment(int pos, String comment) { + List list = comments.get(pos); + if (list == null) { + list = new ArrayList<>(1); + comments.put(pos, list); + } + list.add(encodeString(comment)); } /** diff -r a19b68d309a2 -r 089d48dfe8ce graal/com.oracle.graal.code/src/com/oracle/graal/code/HexCodeFileDisassemblerProvider.java --- a/graal/com.oracle.graal.code/src/com/oracle/graal/code/HexCodeFileDisassemblerProvider.java Wed Nov 25 15:32:07 2015 +0100 +++ b/graal/com.oracle.graal.code/src/com/oracle/graal/code/HexCodeFileDisassemblerProvider.java Thu Nov 26 00:55:12 2015 +0100 @@ -117,8 +117,7 @@ } private static void addOperandComment(HexCodeFile hcf, int pos, String comment) { - String oldValue = hcf.addOperandComment(pos, comment); - assert oldValue == null : "multiple comments for operand of instruction at " + pos + ": " + comment + ", " + oldValue; + hcf.addOperandComment(pos, comment); } /** diff -r a19b68d309a2 -r 089d48dfe8ce graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java Wed Nov 25 15:32:07 2015 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java Thu Nov 26 00:55:12 2015 +0100 @@ -83,7 +83,7 @@ final StructuredGraph graph = parseDebug(method, AllowAssumptions.from(OptAssumptions.getValue())); int graphLineSPs = 0; for (FullInfopointNode ipn : graph.getNodes().filter(FullInfopointNode.class)) { - if (ipn.getReason() == InfopointReason.LINE_NUMBER) { + if (ipn.getReason() == InfopointReason.BYTECODE_POSITION) { ++graphLineSPs; } } @@ -95,7 +95,7 @@ int lineSPs = 0; for (Infopoint sp : cr.getInfopoints()) { assertNotNull(sp.reason); - if (sp.reason == InfopointReason.LINE_NUMBER) { + if (sp.reason == InfopointReason.BYTECODE_POSITION) { ++lineSPs; } } diff -r a19b68d309a2 -r 089d48dfe8ce graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Wed Nov 25 15:32:07 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Thu Nov 26 00:55:12 2015 +0100 @@ -451,7 +451,7 @@ BytecodePosition position = node.getNodeContext(BytecodePosition.class); if (position != null && (lastPosition == null || !lastPosition.equals(position))) { lastPosition = position; - recordSimpleInfopoint(InfopointReason.LINE_NUMBER, position); + recordSimpleInfopoint(InfopointReason.BYTECODE_POSITION, position); } } if (node instanceof LIRLowerable) { diff -r a19b68d309a2 -r 089d48dfe8ce graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java Wed Nov 25 15:32:07 2015 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeParser.java Thu Nov 26 00:55:12 2015 +0100 @@ -1387,7 +1387,7 @@ protected void genThrow() { if (GraalOptions.OldInfopoints.getValue() && graphBuilderConfig.insertNonSafepointDebugInfo() && !parsingIntrinsic()) { - genInfoPointNode(InfopointReason.LINE_NUMBER, null); + genInfoPointNode(InfopointReason.BYTECODE_POSITION, null); } ValueNode exception = frameState.pop(JavaKind.Object); @@ -2638,7 +2638,7 @@ if (GraalOptions.OldInfopoints.getValue() && graphBuilderConfig.insertNonSafepointDebugInfo() && !parsingIntrinsic()) { currentLineNumber = lnt != null ? lnt.getLineNumber(bci) : (graphBuilderConfig.insertFullDebugInfo() ? -1 : bci); if (currentLineNumber != previousLineNumber) { - genInfoPointNode(InfopointReason.LINE_NUMBER, null); + genInfoPointNode(InfopointReason.BYTECODE_POSITION, null); previousLineNumber = currentLineNumber; } } diff -r a19b68d309a2 -r 089d48dfe8ce graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java Wed Nov 25 15:32:07 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java Thu Nov 26 00:55:12 2015 +0100 @@ -276,7 +276,7 @@ if (op instanceof SimpleInfopointOp) { currentInfo = null; } else if (currentInfo != null) { - lirForBlock.add(new SimpleInfopointOp(InfopointReason.LINE_NUMBER, currentInfo)); + lirForBlock.add(new SimpleInfopointOp(InfopointReason.BYTECODE_POSITION, currentInfo)); currentInfo = null; } lirForBlock.add(op);