# HG changeset patch # User Thomas Wuerthinger # Date 1306314771 -7200 # Node ID 79dda81dd3371655a95e419c3e00b7369343c4d3 # Parent 93ec3f0674207a042924d2881a8eb275228dcfb9 Cleanup diff -r 93ec3f067420 -r 79dda81dd337 graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java --- a/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java Wed May 25 11:04:59 2011 +0200 +++ b/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java Wed May 25 11:12:51 2011 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.sun.c1x.debug.*; import com.sun.c1x.ir.*; @@ -73,16 +72,4 @@ public String toString() { return "B" + blockID; } - - public void removeExceptionSuccessors() { - for (int i = 0; i < successors.size(); ++i) { - TTY.println("checking succ"); - if (successors.get(i).isExceptionEntry()) { - TTY.println("removing successor " + i); - successors.remove(i); - i--; - } - } - - } } diff -r 93ec3f067420 -r 79dda81dd337 graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java --- a/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java Wed May 25 11:04:59 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java Wed May 25 11:12:51 2011 +0200 @@ -27,7 +27,6 @@ import java.util.*; -import com.oracle.graal.graph.*; import com.sun.c1x.*; import com.sun.c1x.alloc.Interval.*; import com.sun.c1x.debug.*; diff -r 93ec3f067420 -r 79dda81dd337 graal/GraalCompiler/src/com/sun/c1x/graph/CriticalEdgeFinder.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/CriticalEdgeFinder.java Wed May 25 11:04:59 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/CriticalEdgeFinder.java Wed May 25 11:12:51 2011 +0200 @@ -99,42 +99,16 @@ */ public LIRBlock splitEdge(LIRBlock source, LIRBlock target) { - int backEdgeIndex = target.blockPredecessors().indexOf(source); - // create new successor and mark it for special block order treatment LIRBlock newSucc = new LIRBlock(lirBlocks.size()); lirBlocks.add(newSucc); - List removePhiInputs = null; - for (int i = backEdgeIndex + 1; i < target.blockPredecessors().size(); ++i) { - if (target.blockPredecessors().get(i) == source) { - if (removePhiInputs == null) { - removePhiInputs = new ArrayList(4); - } - removePhiInputs.add(i); - } - } - // This goto is not a safepoint. Goto e = new Goto(target.getInstructions().get(0), graph); newSucc.getInstructions().add(e); - //e.reorderSuccessor(0, backEdgeIndex); // link predecessor to new block ((BlockEnd) source.getInstructions().get(source.getInstructions().size() - 1)).successors().replace(target.getInstructions().get(0), newSucc.getInstructions().get(0)); -/* if (removePhiInputs != null && removePhiInputs.size() > 0) { - - for (Node n : target.getInstructions().get(0).usages()) { - if (n instanceof Phi) { - Phi phi = (Phi) n; - int correction = 0; - for (int index : removePhiInputs) { - phi.removeInput(index - correction); - correction++; - } - } - } - }*/ source.substituteSuccessor(target, newSucc); target.substitutePredecessor(source, newSucc); diff -r 93ec3f067420 -r 79dda81dd337 graal/GraalCompiler/src/com/sun/c1x/graph/IR.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Wed May 25 11:04:59 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Wed May 25 11:12:51 2011 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.graph.*; import com.oracle.max.graal.schedule.*; import com.sun.c1x.*; import com.sun.c1x.debug.*; @@ -109,9 +108,6 @@ // TODO(tw): Schedule nodes within a block. - //computeLinearScanOrder(); - -// assert orderedBlocks.size() == lirBlocks.size(); CriticalEdgeFinder finder = new CriticalEdgeFinder(lirBlocks, compilation.graph); @@ -137,26 +133,6 @@ int z = 0; for (LIRBlock b : orderedBlocks) { b.setLinearScanNumber(z++); - - /* TTY.println(); - - for (Instruction i : b.getInstructions()) { - if (i instanceof BlockBegin) { - TTY.println("BlockBegin #" + ((BlockBegin) i).blockID); - - TTY.print(" => succs: "); - for (LIRBlock succBlock : b.blockSuccessors()) { - TTY.print("B#" + ((BlockBegin) succBlock.getInstructions().get(0)).blockID); - } - TTY.print(" => ex: "); - for (LIRBlock succBlock : b.getExceptionHandlerSuccessors()) { - TTY.print("B#" + ((BlockBegin) succBlock.getInstructions().get(0)).blockID); - } - TTY.println(); - } else { - TTY.println(i.getClass().getSimpleName() + " #" + i.id()); - } - }*/ } @@ -176,55 +152,6 @@ } } - private Map computeLinearScanOrder() { - return makeLinearScanOrder(); - } - - private Map makeLinearScanOrder() { -/* - if (orderedBlocks == null) { - - Map valueToBlock = new HashMap(); - ComputeLinearScanOrder computeLinearScanOrder = new ComputeLinearScanOrder(compilation.stats.blockCount, getHIRStartBlock()); - List blocks = computeLinearScanOrder.linearScanOrder(); - orderedBlocks = new ArrayList(); - - int z = 0; - for (BlockBegin bb : blocks) { - LIRBlock lirBlock = new LIRBlock(z); - lirBlock.getInstructions().add(bb); - valueToBlock.put(bb, lirBlock); - lirBlock.setLinearScanNumber(bb.linearScanNumber()); - // TODO(tw): Initialize LIRBlock.linearScanLoopHeader and LIRBlock.linearScanLoopEnd - orderedBlocks.add(lirBlock); - ++z; - } - - z = 0; - for (BlockBegin bb : blocks) { - LIRBlock lirBlock = orderedBlocks.get(z); - for (int i = 0; i < bb.numberOfPreds(); ++i) { - lirBlock.blockPredecessors().add(valueToBlock.get(bb.predAt(i).block())); - } - - BlockEnd end = bb.end(); - for (int i = 0; i < end.blockSuccessorCount(); ++i) { - lirBlock.blockSuccessors().add(valueToBlock.get(end.blockSuccessor(i))); - } - - Instruction first = bb; - while (first != null) { - lirBlock.getInstructions().add(first); - first = first.next(); - } - ++z; - } - - }*/ - return null; - //return valueToBlock; - } - /** * Gets the linear scan ordering of blocks as a list. * @return the blocks in linear scan order