# HG changeset patch # User Doug Simon # Date 1336724035 -7200 # Node ID 53cc37c27b04fefad0648acee0c505745bc22c8c # Parent 4485e0edd1af42f5d1a610ce34f514f26237f1b8 used more specific BeginNode subclass where appropriate diff -r 4485e0edd1af -r 53cc37c27b04 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java Thu May 10 00:36:12 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java Fri May 11 10:13:55 2012 +0200 @@ -287,7 +287,7 @@ PhiNode exceptionObjectPhi = null; if (invoke instanceof InvokeWithExceptionNode) { InvokeWithExceptionNode invokeWithException = (InvokeWithExceptionNode) invoke; - BeginNode exceptionEdge = invokeWithException.exceptionEdge(); + DispatchBeginNode exceptionEdge = invokeWithException.exceptionEdge(); ExceptionObjectNode exceptionObject = (ExceptionObjectNode) exceptionEdge.next(); exceptionMerge = graph.add(new MergeNode()); @@ -785,7 +785,7 @@ ArrayList nodes = new ArrayList<>(); ReturnNode returnNode = null; UnwindNode unwindNode = null; - BeginNode entryPointNode = inlineGraph.start(); + StartNode entryPointNode = inlineGraph.start(); FixedNode firstCFGNode = entryPointNode.next(); for (Node node : inlineGraph.getNodes()) { if (node == entryPointNode || node == entryPointNode.stateAfter()) { @@ -979,7 +979,7 @@ // Gather the nodes in the snippets that are to be inlined ArrayList nodes = new ArrayList<>(); ReturnNode returnNode = null; - BeginNode entryPointNode = snippetCopy.start(); + StartNode entryPointNode = snippetCopy.start(); FixedNode firstCFGNode = entryPointNode.next(); replacements.clear(); for (Node node : snippetCopy.getNodes()) { diff -r 4485e0edd1af -r 53cc37c27b04 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Thu May 10 00:36:12 2012 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Fri May 11 10:13:55 2012 +0200 @@ -165,7 +165,7 @@ frameState.clearNonLiveLocals(blockMap.startBlock.localsLiveIn); // finish the start block - lastInstr.setStateAfter(frameState.create(0)); + ((StateSplit) lastInstr).setStateAfter(frameState.create(0)); if (blockMap.startBlock.isLoopHeader) { appendGoto(createTarget(blockMap.startBlock, frameState)); } else { @@ -241,7 +241,7 @@ return handler.catchTypeCPI() == 0; } - private BeginNode handleException(ValueNode exceptionObject, int bci) { + private DispatchBeginNode handleException(ValueNode exceptionObject, int bci) { assert bci == FrameState.BEFORE_BCI || bci == bci() : "invalid bci"; Debug.log("Creating exception dispatch edges at %d, exception object=%s, exception seen=%s", bci, exceptionObject, profilingInfo.getExceptionSeen(bci)); @@ -255,7 +255,7 @@ FrameStateBuilder dispatchState = frameState.copy(); dispatchState.clearStack(); - BeginNode dispatchBegin = currentGraph.add(new DispatchBeginNode()); + DispatchBeginNode dispatchBegin = currentGraph.add(new DispatchBeginNode()); dispatchBegin.setStateAfter(dispatchState.create(bci)); if (exceptionObject == null) { @@ -948,7 +948,7 @@ frameState.pushReturn(resultType, result); } else { - BeginNode exceptionEdge = handleException(null, bci()); + DispatchBeginNode exceptionEdge = handleException(null, bci()); InvokeWithExceptionNode invoke = currentGraph.add(new InvokeWithExceptionNode(callTarget, exceptionEdge, bci(), graphId)); ValueNode result = append(invoke); frameState.pushReturn(resultType, result); @@ -1263,7 +1263,7 @@ FixedNode target = createTarget(probability, block, stateAfter); BeginNode begin = BeginNode.begin(target); - assert !(target instanceof DeoptimizeNode && begin.stateAfter() != null) : + assert !(target instanceof DeoptimizeNode && begin instanceof StateSplit) : "We are not allowed to set the stateAfter of the begin node, because we have to deoptimize to a bci _before_ the actual if, so that the interpreter can update the profiling information."; return begin; } diff -r 4485e0edd1af -r 53cc37c27b04 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Thu May 10 00:36:12 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Fri May 11 10:13:55 2012 +0200 @@ -48,7 +48,7 @@ * @param blockSuccessors * @param branchProbability */ - public InvokeWithExceptionNode(MethodCallTargetNode callTarget, BeginNode exceptionEdge, int bci, long leafGraphId) { + public InvokeWithExceptionNode(MethodCallTargetNode callTarget, DispatchBeginNode exceptionEdge, int bci, long leafGraphId) { super(callTarget.returnStamp(), new BeginNode[]{null, exceptionEdge}, new double[]{1.0, 0.0}); this.bci = bci; this.callTarget = callTarget; @@ -57,8 +57,8 @@ this.useForInlining = true; } - public BeginNode exceptionEdge() { - return blockSuccessor(EXCEPTION_EDGE); + public DispatchBeginNode exceptionEdge() { + return (DispatchBeginNode) blockSuccessor(EXCEPTION_EDGE); } public void setExceptionEdge(BeginNode x) { diff -r 4485e0edd1af -r 53cc37c27b04 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Thu May 10 00:36:12 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Fri May 11 10:13:55 2012 +0200 @@ -40,7 +40,7 @@ public static final long INVALID_GRAPH_ID = -1; private static final AtomicLong uniqueGraphIds = new AtomicLong(); - private final BeginNode start; + private final StartNode start; private final RiResolvedMethod method; private final long graphId; @@ -94,7 +94,7 @@ return buf.toString(); } - public BeginNode start() { + public StartNode start() { return start; }