Mercurial > hg > truffle
changeset 2757:152b98832b0e
Merge.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Fri, 20 May 2011 14:52:25 +0200 |
parents | bfcdda4fdd73 (diff) 80b024e75b29 (current diff) |
children | 0c5791bc90fb |
files | graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java |
diffstat | 4 files changed, 12 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Fri May 20 14:50:04 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Fri May 20 14:52:25 2011 +0200 @@ -257,7 +257,6 @@ Instruction target = createTargetAt(0, stateAfter); Goto base = new Goto(target, stateAfter, graph); appendWithBCI(base); - ((BlockBegin) startBlock.firstInstruction).setEnd(base); } public void mergeOrClone(Block target, FrameStateAccess newState) { @@ -375,7 +374,6 @@ unwindBlock = new BlockBegin(bci, ir.nextBlockNumber(), graph); Unwind unwind = new Unwind(null, graph); unwindBlock.appendNext(unwind); - unwindBlock.setEnd(unwind); } successor = unwindBlock; } @@ -403,13 +401,11 @@ ExceptionDispatch end = new ExceptionDispatch(null, entry, null, handler, null, graph); end.setBlockSuccessor(0, successor); dispatchEntry.appendNext(end); - dispatchEntry.setEnd(end); } else { Deoptimize deopt = new Deoptimize(graph); dispatchEntry.appendNext(deopt); Goto end = new Goto(successor, null, graph); deopt.appendNext(end); - dispatchEntry.setEnd(end); } newBlocks.add(dispatchEntry); @@ -426,7 +422,6 @@ FrameState stateWithException = entryState.duplicateModified(bci, CiKind.Void, exception); BlockEnd end = new Goto(successor, stateWithException, graph); exception.appendNext(end); - entry.setEnd(end); if (x instanceof Invoke) { ((Invoke) x).setExceptionEdge(entry); @@ -1165,7 +1160,6 @@ genThrow(bci); BlockEnd end = (BlockEnd) lastInstr; - ((BlockBegin) syncHandler.firstInstruction).setEnd(end); end.setStateAfter(frameState.create(bci())); frameState.initializeFrom(origState); @@ -1246,9 +1240,6 @@ assert end != null : "end should exist after iterating over bytecodes"; FrameState stateAtEnd = frameState.create(bci()); end.setStateAfter(stateAtEnd); - if (block.firstInstruction instanceof BlockBegin) { - ((BlockBegin) block.firstInstruction).setEnd(end); - } return end; }
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Fri May 20 14:50:04 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Fri May 20 14:52:25 2011 +0200 @@ -200,7 +200,6 @@ // This goto is not a safepoint. Goto e = new Goto(target, null, compilation.graph); newSucc.appendNext(e); - newSucc.setEnd(e); e.reorderSuccessor(0, backEdgeIndex); // setup states FrameState s = source.end().stateAfter();
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java Fri May 20 14:50:04 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java Fri May 20 14:52:25 2011 +0200 @@ -41,8 +41,7 @@ private static final int INPUT_COUNT = 1; private static final int INPUT_STATE_BEFORE = 0; - private static final int SUCCESSOR_COUNT = 1; - private static final int SUCCESSOR_END = 0; + private static final int SUCCESSOR_COUNT = 0; @Override protected int inputCount() { @@ -58,7 +57,11 @@ * The last node in the block (which contains the successors). */ public BlockEnd end() { - return (BlockEnd) successors().get(super.successorCount() + SUCCESSOR_END); + Instruction next = next(); + while (!(next instanceof BlockEnd)) { + next = next.next(); + } + return (BlockEnd) next; } @Override @@ -66,11 +69,6 @@ return false; } - public void setEnd(BlockEnd end) { - assert end != null; - successors().set(super.successorCount() + SUCCESSOR_END, end); - } - /** * A unique id used in tracing. */
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java Fri May 20 14:50:04 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java Fri May 20 14:52:25 2011 +0200 @@ -22,6 +22,8 @@ */ package com.sun.c1x.ir; +import java.util.*; + import com.oracle.graal.graph.*; import com.sun.c1x.*; import com.sun.c1x.value.*; @@ -112,10 +114,11 @@ @Override public BlockBegin block() { Instruction cur = this; - while (!(cur instanceof BlockEnd)) { - cur = cur.next(); + while (!(cur instanceof BlockBegin)) { + List<Node> preds = cur.predecessors(); + cur = (Instruction) preds.get(0); } - return ((BlockEnd) cur).begin(); + return (BlockBegin) cur; } /**