comparison graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2718:c1ce2a53d6c3

Attempt to remove dependency between backend and BlockBegin.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Thu, 19 May 2011 16:05:42 +0200
parents c1a9bf38da28
children ae1c50a03297
comparison
equal deleted inserted replaced
2717:bd85cf08720a 2718:c1ce2a53d6c3
103 private int linearScanNumber; 103 private int linearScanNumber;
104 104
105 private BlockBegin dominator; 105 private BlockBegin dominator;
106 106
107 // LIR block 107 // LIR block
108 public final LIRBlock lirBlock = new LIRBlock(); 108 private LIRBlock lirBlock;
109
110 public void setLIRBlock(LIRBlock block) {
111 this.lirBlock = block;
112 }
109 113
110 /** 114 /**
111 * Index of bytecode that generated this node when appended in a basic block. 115 * Index of bytecode that generated this node when appended in a basic block.
112 * Negative values indicate special cases. 116 * Negative values indicate special cases.
113 */ 117 */
162 */ 166 */
163 public int linearScanNumber() { 167 public int linearScanNumber() {
164 return linearScanNumber; 168 return linearScanNumber;
165 } 169 }
166 170
167 /**
168 * Gets the loop depth of this block.
169 * @return the loop depth
170 */
171 public int loopDepth() {
172 return lirBlock.loopDepth;
173 }
174
175 /**
176 * Gets the loop index of this block.
177 * @return the loop index
178 */
179 public int loopIndex() {
180 return lirBlock.loopIndex;
181 }
182
183 public void setDepthFirstNumber(int depthFirstNumber) { 171 public void setDepthFirstNumber(int depthFirstNumber) {
184 assert depthFirstNumber >= 0; 172 assert depthFirstNumber >= 0;
185 this.depthFirstNumber = depthFirstNumber; 173 this.depthFirstNumber = depthFirstNumber;
186 } 174 }
187 175
188 public void setLinearScanNumber(int linearScanNumber) { 176 public void setLinearScanNumber(int linearScanNumber) {
189 this.linearScanNumber = linearScanNumber; 177 this.linearScanNumber = linearScanNumber;
190 }
191
192 public void setLoopDepth(int loopDepth) {
193 this.lirBlock.loopDepth = loopDepth;
194 }
195
196 public void setLoopIndex(int loopIndex) {
197 this.lirBlock.loopIndex = loopIndex;
198 } 178 }
199 179
200 /** 180 /**
201 * Set a flag on this block. 181 * Set a flag on this block.
202 * @param flag the flag to set 182 * @param flag the flag to set
510 */ 490 */
511 public Label label() { 491 public Label label() {
512 return lirBlock().label; 492 return lirBlock().label;
513 } 493 }
514 494
515 public void setLir(LIRList lir) {
516 lirBlock().setLir(lir);
517 }
518
519 public LIRList lir() { 495 public LIRList lir() {
520 return lirBlock().lir(); 496 return lirBlock().lir();
521 } 497 }
522 498
523 public LIRBlock lirBlock() { 499 public LIRBlock lirBlock() {
524 return lirBlock; 500 return lirBlock;
525 }
526
527 public int blockEntryPco() {
528 return lirBlock == null ? 0 : lirBlock.blockEntryPco;
529 }
530
531 public void setBlockEntryPco(int codeOffset) {
532 lirBlock().blockEntryPco = codeOffset;
533 } 501 }
534 502
535 public Instruction predAt(int j) { 503 public Instruction predAt(int j) {
536 return (Instruction) predecessors().get(j); 504 return (Instruction) predecessors().get(j);
537 } 505 }