Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2821:015be60afcf3
removed flags from Value class
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 30 May 2011 17:05:06 +0200 |
parents | d27bdbec3d67 |
children | d54ea877a302 |
comparison
equal
deleted
inserted
replaced
2820:2b8ef0a06391 | 2821:015be60afcf3 |
---|---|
1267 // move current value to referenced phi function | 1267 // move current value to referenced phi function |
1268 if (suxVal instanceof Phi) { | 1268 if (suxVal instanceof Phi) { |
1269 Phi phi = (Phi) suxVal; | 1269 Phi phi = (Phi) suxVal; |
1270 | 1270 |
1271 // curVal can be null without phi being null in conjunction with inlining | 1271 // curVal can be null without phi being null in conjunction with inlining |
1272 if (!phi.isDeadPhi() && curVal != null && curVal != phi) { | 1272 if (!phi.isDead() && curVal != null && curVal != phi) { |
1273 | 1273 |
1274 assert phis.contains(phi); | 1274 assert phis.contains(phi); |
1275 if (phi.valueAt(predIndex) != curVal) { | 1275 if (phi.valueAt(predIndex) != curVal) { |
1276 phi.print(TTY.out()); | 1276 phi.print(TTY.out()); |
1277 } | 1277 } |
1278 assert phi.valueAt(predIndex) == curVal : "curVal=" + curVal + "valueAt(" + predIndex + ")=" + phi.valueAt(predIndex); | 1278 assert phi.valueAt(predIndex) == curVal : "curVal=" + curVal + "valueAt(" + predIndex + ")=" + phi.valueAt(predIndex); |
1279 | 1279 |
1280 assert !phi.isIllegal() : "illegal phi cannot be marked as live"; | 1280 assert !phi.isDead() : "illegal phi cannot be marked as live"; |
1281 if (curVal instanceof Phi) { | 1281 if (curVal instanceof Phi) { |
1282 operandForPhi((Phi) curVal); | 1282 operandForPhi((Phi) curVal); |
1283 } | 1283 } |
1284 CiValue operand = curVal.operand(); | 1284 CiValue operand = curVal.operand(); |
1285 if (operand.isIllegal()) { | 1285 if (operand.isIllegal()) { |
1330 } | 1330 } |
1331 assert predIndex < sux.numberOfPreds(); | 1331 assert predIndex < sux.numberOfPreds(); |
1332 | 1332 |
1333 PhiResolver resolver = new PhiResolver(this); | 1333 PhiResolver resolver = new PhiResolver(this); |
1334 for (Phi phi : phis) { | 1334 for (Phi phi : phis) { |
1335 if (!phi.isDeadPhi()) { | 1335 if (!phi.isDead()) { |
1336 Value curVal = phi.valueAt(predIndex); | 1336 Value curVal = phi.valueAt(predIndex); |
1337 if (curVal != null && curVal != phi) { | 1337 if (curVal != null && curVal != phi) { |
1338 if (curVal instanceof Phi) { | 1338 if (curVal instanceof Phi) { |
1339 operandForPhi((Phi) curVal); | 1339 operandForPhi((Phi) curVal); |
1340 } | 1340 } |
1376 } | 1376 } |
1377 return x.operand(); | 1377 return x.operand(); |
1378 } | 1378 } |
1379 | 1379 |
1380 private CiValue operandForPhi(Phi phi) { | 1380 private CiValue operandForPhi(Phi phi) { |
1381 assert !phi.isDeadPhi(); | 1381 assert !phi.isDead(); |
1382 if (phi.operand().isIllegal()) { | 1382 if (phi.operand().isIllegal()) { |
1383 // allocate a variable for this phi | 1383 // allocate a variable for this phi |
1384 CiVariable operand = newVariable(phi.kind); | 1384 CiVariable operand = newVariable(phi.kind); |
1385 setResult(phi, operand); | 1385 setResult(phi, operand); |
1386 } | 1386 } |
1446 } | 1446 } |
1447 } | 1447 } |
1448 for (int index = 0; index < state.localsSize(); index++) { | 1448 for (int index = 0; index < state.localsSize(); index++) { |
1449 final Value value = state.localAt(index); | 1449 final Value value = state.localAt(index); |
1450 if (value != null) { | 1450 if (value != null) { |
1451 if (!value.isIllegal()) { | 1451 if (!(value instanceof Phi && ((Phi) value).isDead())) { |
1452 walkStateValue(value); | 1452 walkStateValue(value); |
1453 } | 1453 } |
1454 } | 1454 } |
1455 } | 1455 } |
1456 } | 1456 } |
1457 | 1457 |
1458 private void walkStateValue(Value value) { | 1458 private void walkStateValue(Value value) { |
1459 if (value != null) { | 1459 if (value != null) { |
1460 if (value instanceof Phi && !value.isIllegal()) { | 1460 if (value instanceof Phi && !((Phi) value).isDead()) { |
1461 // phi's are special | 1461 // phi's are special |
1462 operandForPhi((Phi) value); | 1462 operandForPhi((Phi) value); |
1463 } else if (value.operand().isIllegal()) { | 1463 } else if (value.operand().isIllegal()) { |
1464 // instruction doesn't have an operand yet | 1464 // instruction doesn't have an operand yet |
1465 CiValue operand = makeOperand(value); | 1465 CiValue operand = makeOperand(value); |