# HG changeset patch # User Gilles Duboscq # Date 1365426785 -7200 # Node ID 87aebe2843a5dcc68d7d7456a335c268e8248fef # Parent 9f56bb503db4ca67b2de11be6d84d26ce52954d4 Use the DeoptimizingNode interface of the Invokes in the LIRGenerator diff -r 9f56bb503db4 -r 87aebe2843a5 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Mon Apr 08 17:27:16 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Mon Apr 08 15:13:05 2013 +0200 @@ -225,6 +225,13 @@ return stateFor(deopt.getDeoptimizationState(), deopt.getDeoptimizationReason()); } + public LIRFrameState stateWithExceptionEdge(DeoptimizingNode deopt, LabelRef exceptionEdge) { + if (!deopt.canDeoptimize()) { + return null; + } + return stateForWithExceptionEdge(deopt.getDeoptimizationState(), deopt.getDeoptimizationReason(), exceptionEdge); + } + public LIRFrameState stateFor(FrameState state, DeoptimizationReason reason) { return stateForWithExceptionEdge(state, reason, null); } @@ -233,6 +240,7 @@ if (needOnlyOopMaps()) { return new LIRFrameState(null, null, null, (short) -1); } + assert state != null; return debugInfoBuilder.build(state, lir.getDeoptimizationReasons().addSpeculation(reason), exceptionEdge); } @@ -603,13 +611,13 @@ Value[] parameters = visitInvokeArguments(cc, callTarget.arguments()); - LIRFrameState callState = null; - if (x.stateAfter() != null) { - callState = stateForWithExceptionEdge(x.stateDuring(), null, x instanceof InvokeWithExceptionNode ? getLIRBlock(((InvokeWithExceptionNode) x).exceptionEdge()) : null); + LabelRef exceptionEdge = null; + if (x instanceof InvokeWithExceptionNode) { + exceptionEdge = getLIRBlock(((InvokeWithExceptionNode) x).exceptionEdge()); } + LIRFrameState callState = stateWithExceptionEdge(x, exceptionEdge); Value result = cc.getReturn(); - if (callTarget instanceof DirectCallTargetNode) { emitDirectCall((DirectCallTargetNode) callTarget, result, parameters, cc.getTemporaries(), callState); } else if (callTarget instanceof IndirectCallTargetNode) {