# HG changeset patch # User Thomas Wuerthinger # Date 1421006696 -3600 # Node ID 1615039504943f2e0cb02c3f6d643b2960e8ed67 # Parent 7b2834339048f116bab5ae8279996ac6d069663d Avoid insertion of block placeholder node. Use begin node instead. diff -r 7b2834339048 -r 161503950494 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 Sun Jan 11 19:51:03 2015 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Sun Jan 11 21:04:56 2015 +0100 @@ -1031,13 +1031,15 @@ * return a placeholder that later can be replaced with a MergeNode when we see * this block again. */ - block.firstInstruction = currentGraph.add(BlockPlaceholderNode.create(this)); - Target target = checkLoopExit(block.firstInstruction, block, state); + FixedNode targetNode; + block.firstInstruction = currentGraph.add(BeginNode.create()); + targetNode = block.firstInstruction; + Target target = checkLoopExit(targetNode, block, state); FixedNode result = target.fixed; block.entryState = target.state == state ? state.copy() : target.state; block.entryState.clearNonLiveLocals(block, liveness, true); - Debug.log("createTarget %s: first visit, result: %s", block, block.firstInstruction); + Debug.log("createTarget %s: first visit, result: %s", block, targetNode); return result; } @@ -1063,13 +1065,13 @@ assert currentBlock == null || currentBlock.getId() < block.getId() : "must not be backward branch"; assert block.firstInstruction.next() == null : "bytecodes already parsed for block"; - if (block.firstInstruction instanceof BlockPlaceholderNode) { + if (block.firstInstruction instanceof BeginNode) { /* * This is the second time we see this block. Create the actual MergeNode and * the End Node for the already existing edge. For simplicity, we leave the * placeholder in the graph and just append the new nodes after the placeholder. */ - BlockPlaceholderNode placeholder = (BlockPlaceholderNode) block.firstInstruction; + BeginNode placeholder = (BeginNode) block.firstInstruction; // The EndNode for the already existing edge. AbstractEndNode end = currentGraph.add(EndNode.create());