# HG changeset patch # User Thomas Wuerthinger # Date 1306238156 -7200 # Node ID 398b8fa5dc8136c8f53c2741e66b77c056725b0d # Parent 3b73b230b86b83cafa92efdae06041ad876091e8 Removed stateAfter from BlockEnd class. Clean up. diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java Tue May 24 13:55:56 2011 +0200 @@ -31,12 +31,12 @@ */ public final class PhiSimplifier { - public PhiSimplifier(IR ir) {/* + public PhiSimplifier(IR ir) { for (Node n : ir.compilation.graph.getNodes()) { if (n instanceof Phi) { simplify((Phi) n); } - }*/ + } } private Value simplify(Value x) { diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Tue May 24 13:55:56 2011 +0200 @@ -31,8 +31,7 @@ import com.oracle.graal.graph.*; import com.sun.c1x.*; import com.sun.c1x.debug.*; -import com.sun.c1x.graph.BlockMap.Block; -import com.sun.c1x.graph.BlockMap.ExceptionBlock; +import com.sun.c1x.graph.BlockMap.*; import com.sun.c1x.ir.*; import com.sun.c1x.util.*; import com.sun.c1x.value.*; @@ -1101,8 +1100,6 @@ genMonitorExit(lock, Instruction.SYNCHRONIZATION_ENTRY_BCI); genThrow(bci); - BlockEnd end = (BlockEnd) lastInstr; - end.setStateAfter(frameState.create(bci())); frameState.initializeFrom(origState); origState.delete(); diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/graph/IR.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Tue May 24 13:55:56 2011 +0200 @@ -31,7 +31,6 @@ import com.sun.c1x.ir.*; import com.sun.c1x.lir.*; import com.sun.c1x.observer.*; -import com.sun.c1x.value.*; /** * This class implements the overall container for the HIR (high-level IR) graph @@ -222,9 +221,12 @@ // create new successor and mark it for special block order treatment BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), false, compilation.graph); - List removePhiInputs = new ArrayList(); + List removePhiInputs = null; for (int i = backEdgeIndex + 1; i < target.predecessors().size(); ++i) { if (target.predecessors().get(i) == source.end()) { + if (removePhiInputs == null) { + removePhiInputs = new ArrayList(); + } removePhiInputs.add(i); } } @@ -236,7 +238,7 @@ // link predecessor to new block source.end().substituteSuccessor(target, newSucc); - if (removePhiInputs.size() > 0) { + if (removePhiInputs != null && removePhiInputs.size() > 0) { for (Node n : target.usages()) { if (n instanceof Phi) { diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java Tue May 24 13:55:56 2011 +0200 @@ -25,7 +25,6 @@ import java.util.*; import com.oracle.graal.graph.*; -import com.sun.c1x.value.*; import com.sun.cri.ci.*; /** @@ -51,25 +50,6 @@ } /** - * The state for this instruction. - */ - @Override - public FrameState stateAfter() { - return (FrameState) successors().get(super.successorCount() + SUCCESSOR_STATE_AFTER); - } - - public FrameState setStateAfter(FrameState n) { - FrameState oldState = stateAfter(); - try { - return (FrameState) successors().set(super.successorCount() + SUCCESSOR_STATE_AFTER, n); - } finally { - if (oldState != n && oldState != null) { - oldState.delete(); - } - } - } - - /** * The list of instructions that produce input for this instruction. */ public BlockBegin blockSuccessor(int index) { diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java Tue May 24 13:55:56 2011 +0200 @@ -24,7 +24,6 @@ import com.oracle.graal.graph.*; import com.sun.c1x.debug.*; -import com.sun.c1x.value.*; import com.sun.cri.ci.*; import com.sun.cri.ri.*; diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/ir/Goto.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Goto.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Goto.java Tue May 24 13:55:56 2011 +0200 @@ -24,7 +24,6 @@ import com.oracle.graal.graph.*; import com.sun.c1x.debug.*; -import com.sun.c1x.value.*; import com.sun.cri.ci.*; /** diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/ir/If.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/If.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/If.java Tue May 24 13:55:56 2011 +0200 @@ -25,7 +25,6 @@ import com.oracle.graal.graph.*; import com.sun.c1x.debug.*; import com.sun.c1x.util.*; -import com.sun.c1x.value.*; import com.sun.cri.ci.*; /** diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/ir/LookupSwitch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/LookupSwitch.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/LookupSwitch.java Tue May 24 13:55:56 2011 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.graph.*; import com.sun.c1x.debug.*; -import com.sun.c1x.value.*; /** * The {@code LookupSwitch} instruction represents a lookup switch bytecode, which has a sorted diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/ir/Switch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Switch.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Switch.java Tue May 24 13:55:56 2011 +0200 @@ -25,7 +25,6 @@ import java.util.*; import com.oracle.graal.graph.*; -import com.sun.c1x.value.*; import com.sun.cri.ci.*; /** diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/ir/TableSwitch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/TableSwitch.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/TableSwitch.java Tue May 24 13:55:56 2011 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.graph.*; import com.sun.c1x.debug.*; -import com.sun.c1x.value.*; /** * The {@code TableSwitch} instruction represents a table switch. diff -r 3b73b230b86b -r 398b8fa5dc81 graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java --- a/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Tue May 24 13:51:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Tue May 24 13:55:56 2011 +0200 @@ -338,7 +338,7 @@ if (x instanceof Phi) { Phi phi = (Phi) x; if (phi.block() == block) { - //phi.makeDead(); + phi.makeDead(); } } inputs().set(i, null);