# HG changeset patch # User Thomas Wuerthinger # Date 1305879399 -7200 # Node ID 03b80fb10ae936bc9d5d482fbda8bce483eb3df3 # Parent d913f3049ceefa2daff3c80f3c72c2cce0318068 More clean up around ComputeLinearScanOrder. diff -r d913f3049cee -r 03b80fb10ae9 graal/GraalCompiler/src/com/sun/c1x/graph/IR.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Thu May 19 17:45:00 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Fri May 20 10:16:39 2011 +0200 @@ -144,7 +144,6 @@ startBlock = getHIRStartBlock().lirBlock(); assert startBlock != null; compilation.stats.loopCount = computeLinearScanOrder.numLoops(); - computeLinearScanOrder.printBlocks(); } } diff -r d913f3049cee -r 03b80fb10ae9 graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java Thu May 19 17:45:00 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ComputeLinearScanOrder.java Fri May 20 10:16:39 2011 +0200 @@ -35,7 +35,6 @@ private final int maxBlockId; // the highest blockId of a block private int numBlocks; // total number of blocks (smaller than maxBlockId) private int numLoops; // total number of loops - private boolean iterativeDominators; // method requires iterative computation of dominators List linearScanOrder; // the resulting list of blocks in correct order @@ -118,9 +117,6 @@ countEdges(startBlock, null); computeOrder(startBlock); - - printBlocks(); - assert verify(); } /** @@ -301,60 +297,4 @@ }); } while (workList.size() > 0); } - - public void printBlocks() { - if (C1XOptions.TraceLinearScanLevel >= 1) { - TTY.println("----- linear-scan block order:"); - for (BlockBegin cur : linearScanOrder) { - TTY.print(String.format("%4d: B%02d loop: %2d depth: %2d", cur.linearScanNumber(), cur.blockID, -1, -1)); - - if (cur.numberOfPreds() > 0) { - TTY.print(" preds: "); - for (int j = 0; j < cur.numberOfPreds(); j++) { - BlockBegin pred = cur.predAt(j).block(); - TTY.print("B%d ", pred.blockID); - } - } - if (cur.numberOfSux() > 0) { - TTY.print(" sux: "); - for (int j = 0; j < cur.numberOfSux(); j++) { - BlockBegin sux = cur.suxAt(j); - TTY.print("B%d ", sux.blockID); - } - } - TTY.println(); - } - } - } - - private boolean verify() { - assert linearScanOrder.size() == numBlocks : "wrong number of blocks in list"; - - if (C1XOptions.StressLinearScan) { - // blocks are scrambled when StressLinearScan is used - return true; - } - - // check that all successors of a block have a higher linear-scan-number - // and that all predecessors of a block have a lower linear-scan-number - // (only backward branches of loops are ignored) - int i; - for (i = 0; i < linearScanOrder.size(); i++) { - BlockBegin cur = linearScanOrder.get(i); - - assert cur.linearScanNumber() == i : "incorrect linearScanNumber"; - assert cur.linearScanNumber() >= 0 && cur.linearScanNumber() == linearScanOrder.indexOf(cur) : "incorrect linearScanNumber"; - - for (BlockBegin sux : cur.end().blockSuccessors()) { - assert sux.linearScanNumber() >= 0 && sux.linearScanNumber() == linearScanOrder.indexOf(sux) : "incorrect linearScanNumber"; - } - - for (Instruction pred : cur.blockPredecessors()) { - BlockBegin begin = pred.block(); - assert begin.linearScanNumber() >= 0 && begin.linearScanNumber() == linearScanOrder.indexOf(begin) : "incorrect linearScanNumber"; - } - } - - return true; - } }