Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2778:2ac7b30b7290
Enabled new block finding algorithm.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Tue, 24 May 2011 21:39:45 +0200 |
parents | 3b73b230b86b |
children | 93ec3f067420 |
comparison
equal
deleted
inserted
replaced
2777:3e4d992fd312 | 2778:2ac7b30b7290 |
---|---|
390 public void visitGoto(Goto x) { | 390 public void visitGoto(Goto x) { |
391 setNoResult(x); | 391 setNoResult(x); |
392 | 392 |
393 // emit phi-instruction moves after safepoint since this simplifies | 393 // emit phi-instruction moves after safepoint since this simplifies |
394 // describing the state at the safepoint. | 394 // describing the state at the safepoint. |
395 moveToPhi(x.stateAfter()); | 395 |
396 | 396 moveToPhi(); |
397 lir.jump(getLIRBlock(x.defaultSuccessor())); | 397 lir.jump(getLIRBlock(x.defaultSuccessor())); |
398 } | 398 } |
399 | 399 |
400 @Override | 400 @Override |
401 public void visitIfOp(IfOp i) { | 401 public void visitIfOp(IfOp i) { |
1264 resolver.move(operand, operandForPhi(phi)); | 1264 resolver.move(operand, operandForPhi(phi)); |
1265 } | 1265 } |
1266 } | 1266 } |
1267 } | 1267 } |
1268 | 1268 |
1269 protected void moveToPhi() { | |
1270 assert lastState != null; | |
1271 this.moveToPhi(lastState); | |
1272 } | |
1273 | |
1274 private List<Phi> getPhis(LIRBlock block) { | 1269 private List<Phi> getPhis(LIRBlock block) { |
1275 if (block.getInstructions().size() > 0) { | 1270 if (block.getInstructions().size() > 0) { |
1276 Instruction i = block.getInstructions().get(0); | 1271 Instruction i = block.getInstructions().get(0); |
1277 if (i instanceof BlockBegin) { | 1272 if (i instanceof BlockBegin) { |
1278 List<Phi> result = new ArrayList<Phi>(); | 1273 List<Phi> result = new ArrayList<Phi>(); |
1285 } | 1280 } |
1286 } | 1281 } |
1287 return null; | 1282 return null; |
1288 } | 1283 } |
1289 | 1284 |
1290 protected void moveToPhi(FrameState curState) { | 1285 protected void moveToPhi() { |
1291 // Moves all stack values into their phi position | 1286 // Moves all stack values into their phi position |
1292 LIRBlock bb = currentBlock; | 1287 LIRBlock bb = currentBlock; |
1293 if (bb.numberOfSux() == 1) { | 1288 if (bb.numberOfSux() == 1) { |
1294 LIRBlock sux = bb.suxAt(0); | 1289 LIRBlock sux = bb.suxAt(0); |
1295 assert sux.numberOfPreds() > 0 : "invalid CFG"; | 1290 assert sux.numberOfPreds() > 0 : "invalid CFG"; |