# HG changeset patch # User Lukas Stadler # Date 1358955886 -3600 # Node ID 417bd4ca6e4aed4e618324aaaff2142beb4a5998 # Parent bbaa734b3627eccba31a78eda94ad520ccdb98b3 handle InvokeWithExceptionNode when inlining macro nodes diff -r bbaa734b3627 -r 417bd4ca6e4a graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Tue Jan 22 22:46:13 2013 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Wed Jan 23 16:44:46 2013 +0100 @@ -207,12 +207,19 @@ assert invoke instanceof InvokeNode; FixedWithNextNode macroNode; try { - macroNode = macroNodeClass.getConstructor(InvokeNode.class).newInstance(invoke); + macroNode = macroNodeClass.getConstructor(Invoke.class).newInstance(invoke); } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) { throw new GraalInternalError(e).addContext(invoke.node()).addContext("macroSubstitution", macroNodeClass); } + macroNode.setProbability(invoke.node().probability()); CallTargetNode callTarget = invoke.callTarget(); - graph.replaceFixedWithFixed((InvokeNode) invoke, graph.add(macroNode)); + if (invoke instanceof InvokeNode) { + graph.replaceFixedWithFixed((InvokeNode) invoke, graph.add(macroNode)); + } else { + InvokeWithExceptionNode invokeWithException = (InvokeWithExceptionNode) invoke; + invokeWithException.killExceptionEdge(); + graph.replaceSplitWithFixed(invokeWithException, graph.add(macroNode), invokeWithException.next()); + } GraphUtil.killWithUnusedFloatingInputs(callTarget); } else { StructuredGraph calleeGraph = getIntrinsicGraph(concrete); diff -r bbaa734b3627 -r 417bd4ca6e4a graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MacroNode.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MacroNode.java Tue Jan 22 22:46:13 2013 +0100 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MacroNode.java Wed Jan 23 16:44:46 2013 +0100 @@ -33,14 +33,14 @@ public class MacroNode extends AbstractStateSplit implements Lowerable { - @Input protected NodeInputList arguments; + @Input protected final NodeInputList arguments; private final int bci; private final ResolvedJavaMethod targetMethod; private final JavaType returnType; - protected MacroNode(InvokeNode invoke) { - super(invoke.stamp(), invoke.stateAfter()); + protected MacroNode(Invoke invoke) { + super(invoke.node().stamp(), invoke.stateAfter()); this.arguments = new NodeInputList<>(this, invoke.methodCallTarget().arguments()); this.bci = invoke.bci(); this.targetMethod = invoke.methodCallTarget().targetMethod();