Mercurial > hg > truffle
diff graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java @ 2793:d3fc4fe063bf
Rename BlockBegin to Merge, remove some Block related member from it. Made CFGPrinter work with the Block class from schedule
author | Gilles Duboscq <gilles.duboscq@oracle.com> |
---|---|
date | Fri, 27 May 2011 11:08:55 +0200 |
parents | 50677668afe3 |
children | e1dad0edd57a |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java Thu May 26 11:55:16 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java Fri May 27 11:08:55 2011 +0200 @@ -59,7 +59,7 @@ public Instruction setBlockSuccessor(int index, Instruction n) { assert index >= 0 && index < blockSuccessorCount; // assert n == null || n instanceof BlockBegin : "only BlockBegins, for now... " + n.getClass(); - return (BlockBegin) successors().set(super.successorCount() + SUCCESSOR_COUNT + index, n); + return (Merge) successors().set(super.successorCount() + SUCCESSOR_COUNT + index, n); } public int blockSuccessorCount() { @@ -91,10 +91,10 @@ * Gets the block begin associated with this block end. * @return the beginning of this basic block */ - public BlockBegin begin() { + public Merge begin() { for (Node n : predecessors()) { - if (n instanceof BlockBegin) { - return (BlockBegin) n; + if (n instanceof Merge) { + return (Merge) n; } } return null; @@ -106,7 +106,7 @@ * @param oldSucc the old successor to replace * @param newSucc the new successor */ - public int substituteSuccessor(BlockBegin oldSucc, BlockBegin newSucc) { + public int substituteSuccessor(Merge oldSucc, Merge newSucc) { assert newSucc != null; int count = 0; for (int i = 0; i < blockSuccessorCount; i++) { @@ -132,7 +132,7 @@ * @param b the block to search for in the successor list * @return the index of the block in the list if found; <code>-1</code> otherwise */ - public int successorIndex(BlockBegin b) { + public int successorIndex(Merge b) { for (int i = 0; i < blockSuccessorCount; i++) { if (blockSuccessor(i) == b) { return i; @@ -146,8 +146,8 @@ * @return the successor list */ @SuppressWarnings({ "unchecked", "rawtypes"}) - public List<BlockBegin> blockSuccessors() { - List<BlockBegin> list = (List) successors().subList(super.successorCount() + SUCCESSOR_COUNT, super.successorCount() + blockSuccessorCount + SUCCESSOR_COUNT); + public List<Instruction> blockSuccessors() { + List<Instruction> list = (List) successors().subList(super.successorCount() + SUCCESSOR_COUNT, super.successorCount() + blockSuccessorCount + SUCCESSOR_COUNT); return Collections.unmodifiableList(list); }