comparison graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2640:9e30cf6dcf96

More frame state fixes. All jtt tests passing now again.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 11 May 2011 14:02:08 +0200
parents 8e96b2b3a866
children d1c5a798b73c
comparison
equal deleted inserted replaced
2639:8e96b2b3a866 2640:9e30cf6dcf96
988 MonitorAddress lockAddress = null; 988 MonitorAddress lockAddress = null;
989 if (compilation.runtime.sizeOfBasicObjectLock() != 0) { 989 if (compilation.runtime.sizeOfBasicObjectLock() != 0) {
990 lockAddress = new MonitorAddress(lockNumber, graph); 990 lockAddress = new MonitorAddress(lockNumber, graph);
991 append(lockAddress); 991 append(lockAddress);
992 } 992 }
993 frameState.push(CiKind.Object, x);
994 MonitorEnter monitorEnter = new MonitorEnter(x, lockAddress, lockNumber, graph); 993 MonitorEnter monitorEnter = new MonitorEnter(x, lockAddress, lockNumber, graph);
995 frameState.apop();
996 appendWithoutOptimization(monitorEnter, bci); 994 appendWithoutOptimization(monitorEnter, bci);
997 frameState.lock(ir, x, lockNumber + 1); 995 frameState.lock(ir, x, lockNumber + 1);
998 monitorEnter.setStateAfter(frameState.create(bci)); 996 if (bci == Instruction.SYNCHRONIZATION_ENTRY_BCI) {
997 monitorEnter.setStateAfter(frameState.create(0));
998 }
999 killMemoryMap(); // prevent any optimizations across synchronization 999 killMemoryMap(); // prevent any optimizations across synchronization
1000 } 1000 }
1001 1001
1002 void genMonitorExit(Value x, int bci) { 1002 void genMonitorExit(Value x, int bci) {
1003 int lockNumber = frameState.locksSize() - 1; 1003 int lockNumber = frameState.locksSize() - 1;
1266 1266
1267 if (lastInstr instanceof BlockEnd) { 1267 if (lastInstr instanceof BlockEnd) {
1268 end = (BlockEnd) lastInstr; 1268 end = (BlockEnd) lastInstr;
1269 break; 1269 break;
1270 } 1270 }
1271 stream.next();
1272 bci = stream.currentBCI();
1271 if (lastInstr instanceof StateSplit) { 1273 if (lastInstr instanceof StateSplit) {
1272 StateSplit stateSplit = (StateSplit) lastInstr; 1274 StateSplit stateSplit = (StateSplit) lastInstr;
1273 if (stateSplit.stateAfter() == null && stateSplit.needsStateAfter()) { 1275 if (stateSplit.stateAfter() == null && stateSplit.needsStateAfter()) {
1274 stateSplit.setStateAfter(frameState.create(bci)); 1276 stateSplit.setStateAfter(frameState.create(bci));
1275 } 1277 }
1276 } 1278 }
1277 stream.next();
1278 bci = stream.currentBCI();
1279 blockStart = false; 1279 blockStart = false;
1280 } 1280 }
1281 1281
1282 // if the method terminates, we don't need the stack anymore 1282 // if the method terminates, we don't need the stack anymore
1283 if (end instanceof Return || end instanceof Throw) { 1283 if (end instanceof Return || end instanceof Throw) {