# HG changeset patch # User Thomas Wuerthinger # Date 1358441340 -3600 # Node ID 600f7bad141cd09c80601f091ce66f6f3893fb8d # Parent 0f8c6dbf68be73b6d7760b28df1810100c8bb053 Small clean up of the Block class. diff -r 0f8c6dbf68be -r 600f7bad141c graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Thu Jan 17 17:21:16 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Thu Jan 17 17:49:00 2013 +0100 @@ -807,9 +807,8 @@ // block has successors if (n > 0) { liveOut.clear(); - liveOut.or(blockData.get(block.getFirstSuccessor()).liveIn); - for (int j = 1; j < n; j++) { - liveOut.or(blockData.get(block.suxAt(j)).liveIn); + for (Block successor : block.getSuccessors()) { + liveOut.or(blockData.get(successor).liveIn); } } else { liveOut.clear(); diff -r 0f8c6dbf68be -r 600f7bad141c graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java Thu Jan 17 17:21:16 2013 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java Thu Jan 17 17:49:00 2013 +0100 @@ -62,7 +62,7 @@ assert instructions.size() >= 2 : "block must have label and branch"; assert instructions.get(0) instanceof StandardOp.LabelOp : "first instruction must always be a label"; assert instructions.get(instructions.size() - 1) instanceof StandardOp.JumpOp : "last instruction must always be a branch"; - assert ((StandardOp.JumpOp) instructions.get(instructions.size() - 1)).destination().label() == ((StandardOp.LabelOp) ir.lir(block.suxAt(0)).get(0)).getLabel() : "branch target must be the successor"; + assert ((StandardOp.JumpOp) instructions.get(instructions.size() - 1)).destination().label() == ((StandardOp.LabelOp) ir.lir(block.getFirstSuccessor()).get(0)).getLabel() : "branch target must be the successor"; // Block must have exactly one successor. return instructions.size() == 2 && !instructions.get(instructions.size() - 1).hasState(); diff -r 0f8c6dbf68be -r 600f7bad141c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java Thu Jan 17 17:21:16 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java Thu Jan 17 17:49:00 2013 +0100 @@ -34,7 +34,6 @@ protected BeginNode beginNode; protected FixedNode endNode; protected Loop loop; - protected double probability; protected List predecessors; protected List successors; @@ -186,11 +185,6 @@ return getSuccessors().size(); } - public Block suxAt(int i) { - return getSuccessors().get(i); - } -// end to be inlined later on - public boolean dominates(Block block) { return block.isDominatedBy(this); } diff -r 0f8c6dbf68be -r 600f7bad141c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/ControlFlowGraph.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/ControlFlowGraph.java Thu Jan 17 17:21:16 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/ControlFlowGraph.java Thu Jan 17 17:49:00 2013 +0100 @@ -131,13 +131,6 @@ } } - if (cur instanceof FixedNode) { - double probability = ((FixedNode) cur).probability(); - if (probability > block.probability) { - block.probability = probability; - } - } - last = cur; cur = cur.successors().first(); } while (cur != null && !(cur instanceof BeginNode));