comparison graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2700:d06cff53b77e

More cleanup.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 18 May 2011 16:09:31 +0200
parents 773189811d10
children 42450f536d24
comparison
equal deleted inserted replaced
2697:bd4c3be86fb7 2700:d06cff53b77e
95 StandardEntry, 95 StandardEntry,
96 ExceptionEntry, 96 ExceptionEntry,
97 BackwardBranchTarget, 97 BackwardBranchTarget,
98 IsOnWorkList, 98 IsOnWorkList,
99 WasVisited, 99 WasVisited,
100 DefaultExceptionHandler,
101 ParserLoopHeader, 100 ParserLoopHeader,
102 CriticalEdgeSplit, 101 CriticalEdgeSplit,
103 LinearScanLoopHeader, 102 LinearScanLoopHeader,
104 LinearScanLoopEnd; 103 LinearScanLoopEnd;
105 104
121 */ 120 */
122 private final List<BlockEnd> predecessors; 121 private final List<BlockEnd> predecessors;
123 122
124 private int depthFirstNumber; 123 private int depthFirstNumber;
125 private int linearScanNumber; 124 private int linearScanNumber;
126 private int loopDepth;
127 private int loopIndex;
128 125
129 private BlockBegin dominator; 126 private BlockBegin dominator;
130 private List<BlockBegin> exceptionHandlerBlocks; 127 private List<BlockBegin> exceptionHandlerBlocks;
131 private List<FrameState> exceptionHandlerStates; 128 private List<FrameState> exceptionHandlerStates;
132 129
133 // LIR block 130 // LIR block
134 public LIRBlock lirBlock; 131 public final LIRBlock lirBlock = new LIRBlock();
135 132
136 /** 133 /**
137 * Constructs a new BlockBegin at the specified bytecode index. 134 * Constructs a new BlockBegin at the specified bytecode index.
138 * @param bci the bytecode index of the start 135 * @param bci the bytecode index of the start
139 * @param blockID the ID of the block 136 * @param blockID the ID of the block
143 super(CiKind.Illegal, INPUT_COUNT, SUCCESSOR_COUNT, graph); 140 super(CiKind.Illegal, INPUT_COUNT, SUCCESSOR_COUNT, graph);
144 this.blockID = blockID; 141 this.blockID = blockID;
145 depthFirstNumber = -1; 142 depthFirstNumber = -1;
146 linearScanNumber = -1; 143 linearScanNumber = -1;
147 predecessors = new ArrayList<BlockEnd>(2); 144 predecessors = new ArrayList<BlockEnd>(2);
148 loopIndex = -1;
149 setBCI(bci); 145 setBCI(bci);
150 } 146 }
151 147
152 /** 148 /**
153 * Gets the list of predecessors of this block. 149 * Gets the list of predecessors of this block.
185 /** 181 /**
186 * Gets the loop depth of this block. 182 * Gets the loop depth of this block.
187 * @return the loop depth 183 * @return the loop depth
188 */ 184 */
189 public int loopDepth() { 185 public int loopDepth() {
190 return loopDepth; 186 return lirBlock.loopDepth;
191 } 187 }
192 188
193 /** 189 /**
194 * Gets the loop index of this block. 190 * Gets the loop index of this block.
195 * @return the loop index 191 * @return the loop index
196 */ 192 */
197 public int loopIndex() { 193 public int loopIndex() {
198 return loopIndex; 194 return lirBlock.loopIndex;
199 } 195 }
200 196
201 /** 197 /**
202 * Gets the exception handlers that cover one or more instructions of this basic block. 198 * Gets the exception handlers that cover one or more instructions of this basic block.
203 * 199 *
219 public void setLinearScanNumber(int linearScanNumber) { 215 public void setLinearScanNumber(int linearScanNumber) {
220 this.linearScanNumber = linearScanNumber; 216 this.linearScanNumber = linearScanNumber;
221 } 217 }
222 218
223 public void setLoopDepth(int loopDepth) { 219 public void setLoopDepth(int loopDepth) {
224 this.loopDepth = loopDepth; 220 this.lirBlock.loopDepth = loopDepth;
225 } 221 }
226 222
227 public void setLoopIndex(int loopIndex) { 223 public void setLoopIndex(int loopIndex) {
228 this.loopIndex = loopIndex; 224 this.lirBlock.loopIndex = loopIndex;
229 } 225 }
230 226
231 /** 227 /**
232 * Set a flag on this block. 228 * Set a flag on this block.
233 * @param flag the flag to set 229 * @param flag the flag to set
619 public LIRList lir() { 615 public LIRList lir() {
620 return lirBlock().lir(); 616 return lirBlock().lir();
621 } 617 }
622 618
623 public LIRBlock lirBlock() { 619 public LIRBlock lirBlock() {
624 if (lirBlock == null) {
625 lirBlock = new LIRBlock();
626 }
627 return lirBlock; 620 return lirBlock;
628 } 621 }
629 622
630 public int exceptionHandlerPco() { 623 public int exceptionHandlerPco() {
631 return lirBlock == null ? 0 : lirBlock.exceptionHandlerPCO; 624 return lirBlock == null ? 0 : lirBlock.exceptionHandlerPCO;