comparison graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2826:d54ea877a302

Merge
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Mon, 30 May 2011 18:02:55 +0200
parents 9ba6a8abe894 015be60afcf3
children 1cd59ca9ac86 bfce42cd9c07 caf55daa41dc
comparison
equal deleted inserted replaced
2825:9ba6a8abe894 2826:d54ea877a302
1278 // move current value to referenced phi function 1278 // move current value to referenced phi function
1279 if (suxVal instanceof Phi) { 1279 if (suxVal instanceof Phi) {
1280 Phi phi = (Phi) suxVal; 1280 Phi phi = (Phi) suxVal;
1281 1281
1282 // curVal can be null without phi being null in conjunction with inlining 1282 // curVal can be null without phi being null in conjunction with inlining
1283 if (!phi.isDeadPhi() && curVal != null && curVal != phi) { 1283 if (!phi.isDead() && curVal != null && curVal != phi) {
1284 1284
1285 assert phis.contains(phi); 1285 assert phis.contains(phi);
1286 if (phi.valueAt(predIndex) != curVal) { 1286 if (phi.valueAt(predIndex) != curVal) {
1287 phi.print(TTY.out()); 1287 phi.print(TTY.out());
1288 } 1288 }
1289 assert phi.valueAt(predIndex) == curVal : "curVal=" + curVal + "valueAt(" + predIndex + ")=" + phi.valueAt(predIndex); 1289 assert phi.valueAt(predIndex) == curVal : "curVal=" + curVal + "valueAt(" + predIndex + ")=" + phi.valueAt(predIndex);
1290 1290
1291 assert !phi.isIllegal() : "illegal phi cannot be marked as live"; 1291 assert !phi.isDead() : "illegal phi cannot be marked as live";
1292 if (curVal instanceof Phi) { 1292 if (curVal instanceof Phi) {
1293 operandForPhi((Phi) curVal); 1293 operandForPhi((Phi) curVal);
1294 } 1294 }
1295 CiValue operand = curVal.operand(); 1295 CiValue operand = curVal.operand();
1296 if (operand.isIllegal()) { 1296 if (operand.isIllegal()) {
1341 } 1341 }
1342 assert predIndex < sux.numberOfPreds(); 1342 assert predIndex < sux.numberOfPreds();
1343 1343
1344 PhiResolver resolver = new PhiResolver(this); 1344 PhiResolver resolver = new PhiResolver(this);
1345 for (Phi phi : phis) { 1345 for (Phi phi : phis) {
1346 if (!phi.isDeadPhi()) { 1346 if (!phi.isDead()) {
1347 Value curVal = phi.valueAt(predIndex); 1347 Value curVal = phi.valueAt(predIndex);
1348 if (curVal != null && curVal != phi) { 1348 if (curVal != null && curVal != phi) {
1349 if (curVal instanceof Phi) { 1349 if (curVal instanceof Phi) {
1350 operandForPhi((Phi) curVal); 1350 operandForPhi((Phi) curVal);
1351 } 1351 }
1387 } 1387 }
1388 return x.operand(); 1388 return x.operand();
1389 } 1389 }
1390 1390
1391 private CiValue operandForPhi(Phi phi) { 1391 private CiValue operandForPhi(Phi phi) {
1392 assert !phi.isDeadPhi(); 1392 assert !phi.isDead();
1393 if (phi.operand().isIllegal()) { 1393 if (phi.operand().isIllegal()) {
1394 // allocate a variable for this phi 1394 // allocate a variable for this phi
1395 CiVariable operand = newVariable(phi.kind); 1395 CiVariable operand = newVariable(phi.kind);
1396 setResult(phi, operand); 1396 setResult(phi, operand);
1397 } 1397 }
1457 } 1457 }
1458 } 1458 }
1459 for (int index = 0; index < state.localsSize(); index++) { 1459 for (int index = 0; index < state.localsSize(); index++) {
1460 final Value value = state.localAt(index); 1460 final Value value = state.localAt(index);
1461 if (value != null) { 1461 if (value != null) {
1462 if (!value.isIllegal()) { 1462 if (!(value instanceof Phi && ((Phi) value).isDead())) {
1463 walkStateValue(value); 1463 walkStateValue(value);
1464 } 1464 }
1465 } 1465 }
1466 } 1466 }
1467 } 1467 }
1468 1468
1469 private void walkStateValue(Value value) { 1469 private void walkStateValue(Value value) {
1470 if (value != null) { 1470 if (value != null) {
1471 if (value instanceof Phi && !value.isIllegal()) { 1471 if (value instanceof Phi && !((Phi) value).isDead()) {
1472 // phi's are special 1472 // phi's are special
1473 operandForPhi((Phi) value); 1473 operandForPhi((Phi) value);
1474 } else if (value.operand().isIllegal()) { 1474 } else if (value.operand().isIllegal()) {
1475 // instruction doesn't have an operand yet 1475 // instruction doesn't have an operand yet
1476 CiValue operand = makeOperand(value); 1476 CiValue operand = makeOperand(value);