comparison graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2730:027adfafd47e

first batch of GraphBuilder changes to remove dependencies on BlockBegin
author Lukas Stadler <lukas.stadler@jku.at>
date Thu, 19 May 2011 17:24:23 +0200
parents 108adba3345e
children 2ef23785ca93
comparison
equal deleted inserted replaced
2729:108adba3345e 2730:027adfafd47e
81 81
82 private int depthFirstNumber; 82 private int depthFirstNumber;
83 private int linearScanNumber; 83 private int linearScanNumber;
84 84
85 // LIR block 85 // LIR block
86 private LIRBlock lirBlock; 86 public LIRBlock lirBlock;
87 87
88 public void setLIRBlock(LIRBlock block) { 88 public void setLIRBlock(LIRBlock block) {
89 this.lirBlock = block; 89 this.lirBlock = block;
90 } 90 }
91 91
264 @Override 264 @Override
265 public void accept(ValueVisitor v) { 265 public void accept(ValueVisitor v) {
266 v.visitBlockBegin(this); 266 v.visitBlockBegin(this);
267 } 267 }
268 268
269 public void mergeOrClone(FrameStateAccess newState, RiMethod method) { 269 public void mergeOrClone(FrameStateAccess newState, RiMethod method, boolean loopHeader) {
270 FrameState existingState = stateBefore(); 270 FrameState existingState = stateBefore();
271 271
272 if (existingState == null) { 272 if (existingState == null) {
273 // copy state because it is modified 273 // copy state because it is modified
274 FrameState duplicate = newState.duplicate(bci()); 274 FrameState duplicate = newState.duplicate(bci());
275 275
276 // if the block is a loop header, insert all necessary phis 276 // if the block is a loop header, insert all necessary phis
277 if (isParserLoopHeader()) { 277 if (loopHeader) {
278 insertLoopPhis(duplicate); 278 insertLoopPhis(duplicate);
279 } 279 }
280 280
281 setStateBefore(duplicate); 281 setStateBefore(duplicate);
282 } else { 282 } else {
303 Value x = newState.localAt(i); 303 Value x = newState.localAt(i);
304 if (x != null) { 304 if (x != null) {
305 newState.setupPhiForLocal(this, i); 305 newState.setupPhiForLocal(this, i);
306 } 306 }
307 } 307 }
308 }
309
310 boolean parserLoopHeader;
311
312 public boolean isParserLoopHeader() {
313 return parserLoopHeader;
314 }
315
316 public void setParserLoopHeader(boolean value) {
317 parserLoopHeader = value;
318 } 308 }
319 309
320 @Override 310 @Override
321 public String toString() { 311 public String toString() {
322 StringBuilder builder = new StringBuilder(); 312 StringBuilder builder = new StringBuilder();
381 BlockEnd end = end(); 371 BlockEnd end = end();
382 out.print("B").print(blockID).print(" "); 372 out.print("B").print(blockID).print(" ");
383 373
384 // print flags 374 // print flags
385 StringBuilder sb = new StringBuilder(8); 375 StringBuilder sb = new StringBuilder(8);
386 if (isParserLoopHeader()) {
387 sb.append("LH");
388 }
389 if (sb.length() != 0) { 376 if (sb.length() != 0) {
390 out.print('(').print(sb.toString()).print(')'); 377 out.print('(').print(sb.toString()).print(')');
391 } 378 }
392 379
393 // print block bci range 380 // print block bci range