# HG changeset patch # User Thomas Wuerthinger # Date 1305895945 -7200 # Node ID 152b98832b0ebb7f344cef01ea15325939568b3e # Parent bfcdda4fdd7318e571e70e4709c6e2d8baaec782# Parent 80b024e75b2945cca9f6da6b0fac28bea4ab2ade Merge. diff -r bfcdda4fdd73 -r 152b98832b0e graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Fri May 20 14:51:45 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Fri May 20 14:52:25 2011 +0200 @@ -580,8 +580,9 @@ } } - protected LIRBlock getLIRBlock(BlockBegin b) { - return b.lirBlock(); + protected LIRBlock getLIRBlock(Instruction b) { + assert b instanceof BlockBegin : "only BlockBegin, for now..."; + return ((BlockBegin) b).lirBlock(); } @Override diff -r bfcdda4fdd73 -r 152b98832b0e graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Fri May 20 14:51:45 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Fri May 20 14:52:25 2011 +0200 @@ -1172,8 +1172,7 @@ while ((block = removeFromWorkList()) != null) { // remove blocks that have no predecessors by the time it their bytecodes are parsed - Instruction firstInstruction = block.firstInstruction; - if (firstInstruction.predecessors().size() == 0) { + if (block.firstInstruction == null) { markVisited(block); continue; } @@ -1181,9 +1180,9 @@ if (!isVisited(block)) { markVisited(block); // now parse the block - frameState.initializeFrom(((BlockBegin) firstInstruction).stateBefore()); - lastInstr = firstInstruction; - assert firstInstruction.next() == null; + frameState.initializeFrom(((BlockBegin) block.firstInstruction).stateBefore()); + lastInstr = block.firstInstruction; + assert block.firstInstruction.next() == null; iterateBytecodesForBlock(block); } diff -r bfcdda4fdd73 -r 152b98832b0e graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java Fri May 20 14:51:45 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java Fri May 20 14:52:25 2011 +0200 @@ -101,17 +101,6 @@ return blockSuccessor(istrue ? 1 : 0); } - /** - * Swaps the successor blocks to this if and negates the condition (e.g. == goes to !=) - * @see Condition#negate() - */ - public void swapSuccessors() { - BlockBegin t = blockSuccessor(0); - BlockBegin f = blockSuccessor(1); - setBlockSuccessor(0, f); - setBlockSuccessor(1, t); - } - @Override public void accept(ValueVisitor v) { v.visitExceptionDispatch(this); diff -r bfcdda4fdd73 -r 152b98832b0e graal/GraalCompiler/src/com/sun/c1x/ir/If.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/If.java Fri May 20 14:51:45 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/If.java Fri May 20 14:52:25 2011 +0200 @@ -116,7 +116,7 @@ * Gets the block corresponding to the true successor. * @return the true successor */ - public BlockBegin trueSuccessor() { + public Instruction trueSuccessor() { return blockSuccessor(0); } @@ -124,7 +124,7 @@ * Gets the block corresponding to the false successor. * @return the false successor */ - public BlockBegin falseSuccessor() { + public Instruction falseSuccessor() { return blockSuccessor(1); } @@ -133,7 +133,7 @@ * @param istrue {@code true} if the true successor is requested, {@code false} otherwise * @return the corresponding successor */ - public BlockBegin successor(boolean istrue) { + public Instruction successor(boolean istrue) { return blockSuccessor(istrue ? 0 : 1); } @@ -141,7 +141,7 @@ * Gets the successor of this instruction for the unordered case. * @return the successor for unordered inputs */ - public BlockBegin unorderedSuccessor() { + public Instruction unorderedSuccessor() { return successor(unorderedIsTrue()); } @@ -163,8 +163,8 @@ public void swapSuccessors() { unorderedIsTrue = !unorderedIsTrue; condition = condition.negate(); - BlockBegin t = blockSuccessor(0); - BlockBegin f = blockSuccessor(1); + Instruction t = blockSuccessor(0); + Instruction f = blockSuccessor(1); setBlockSuccessor(0, f); setBlockSuccessor(1, t); } diff -r bfcdda4fdd73 -r 152b98832b0e graal/GraalCompiler/src/com/sun/c1x/ir/Invoke.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Invoke.java Fri May 20 14:51:45 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Invoke.java Fri May 20 14:52:25 2011 +0200 @@ -74,8 +74,8 @@ return (BlockBegin) successors().get(super.successorCount() + SUCCESSOR_EXCEPTION_EDGE); } - public BlockBegin setExceptionEdge(BlockBegin n) { - return (BlockBegin) successors().set(super.successorCount() + SUCCESSOR_EXCEPTION_EDGE, n); + public Instruction setExceptionEdge(Instruction n) { + return (Instruction) successors().set(super.successorCount() + SUCCESSOR_EXCEPTION_EDGE, n); } public final int opcode;