comparison graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2756:bfcdda4fdd73

Removed the direct connection between BlockBegin and BlockEnd.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Fri, 20 May 2011 14:51:45 +0200
parents 0d268cf66e24
children b72e6638b9e6
comparison
equal deleted inserted replaced
2754:e91608c2daff 2756:bfcdda4fdd73
39 public final class BlockBegin extends StateSplit { 39 public final class BlockBegin extends StateSplit {
40 40
41 private static final int INPUT_COUNT = 1; 41 private static final int INPUT_COUNT = 1;
42 private static final int INPUT_STATE_BEFORE = 0; 42 private static final int INPUT_STATE_BEFORE = 0;
43 43
44 private static final int SUCCESSOR_COUNT = 1; 44 private static final int SUCCESSOR_COUNT = 0;
45 private static final int SUCCESSOR_END = 0;
46 45
47 @Override 46 @Override
48 protected int inputCount() { 47 protected int inputCount() {
49 return super.inputCount() + INPUT_COUNT; 48 return super.inputCount() + INPUT_COUNT;
50 } 49 }
56 55
57 /** 56 /**
58 * The last node in the block (which contains the successors). 57 * The last node in the block (which contains the successors).
59 */ 58 */
60 public BlockEnd end() { 59 public BlockEnd end() {
61 return (BlockEnd) successors().get(super.successorCount() + SUCCESSOR_END); 60 Instruction next = next();
61 while (!(next instanceof BlockEnd)) {
62 next = next.next();
63 }
64 return (BlockEnd) next;
62 } 65 }
63 66
64 @Override 67 @Override
65 public boolean needsStateAfter() { 68 public boolean needsStateAfter() {
66 return false; 69 return false;
67 }
68
69 public void setEnd(BlockEnd end) {
70 assert end != null;
71 successors().set(super.successorCount() + SUCCESSOR_END, end);
72 } 70 }
73 71
74 /** 72 /**
75 * A unique id used in tracing. 73 * A unique id used in tracing.
76 */ 74 */