# HG changeset patch # User Thomas Wuerthinger # Date 1305115328 -7200 # Node ID 9e30cf6dcf962a5a249e014bf89796f569b10db4 # Parent 8e96b2b3a866a83077e24df92a59e2057329dbef More frame state fixes. All jtt tests passing now again. diff -r 8e96b2b3a866 -r 9e30cf6dcf96 graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Wed May 11 13:41:35 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Wed May 11 14:02:08 2011 +0200 @@ -469,6 +469,24 @@ for (int i = 0; i < argumentCount; i++) { Value arg = invoke.argument(i); if (arg != null) { + //builder.push(arg.kind, arg); + } + } + return builder.create(invoke.bci()); + } + + protected FrameState stateBeforeInvokeWithArguments(Invoke invoke) { + + FrameState stateAfter = invoke.stateAfter(); + FrameStateBuilder builder = new FrameStateBuilder(compilation.method, invoke.graph()); + builder.initializeFrom(stateAfter); + if (invoke.kind != CiKind.Void) { + builder.pop(invoke.kind); + } + int argumentCount = invoke.argumentCount(); // invoke.arguments() iterable? + for (int i = 0; i < argumentCount; i++) { + Value arg = invoke.argument(i); + if (arg != null) { builder.push(arg.kind, arg); } } @@ -478,7 +496,8 @@ @Override public void visitInvoke(Invoke x) { RiMethod target = x.target(); - LIRDebugInfo info = stateFor(x, stateBeforeInvoke(x)); + LIRDebugInfo info = stateFor(x, stateBeforeInvokeWithArguments(x)); + LIRDebugInfo info2 = stateFor(x, stateBeforeInvoke(x)); XirSnippet snippet = null; @@ -522,11 +541,11 @@ if (destinationAddress instanceof CiConstant) { // Direct call assert ((CiConstant) destinationAddress).isDefaultValue() : "destination address should be zero"; - lir.callDirect(target, resultOperand, argList, info, snippet.marks, pointerSlots); + lir.callDirect(target, resultOperand, argList, info2, snippet.marks, pointerSlots); } else { // Indirect call argList.add(destinationAddress); - lir.callIndirect(target, resultOperand, argList, info, snippet.marks, pointerSlots); + lir.callIndirect(target, resultOperand, argList, info2, snippet.marks, pointerSlots); } if (resultOperand.isLegal()) { diff -r 8e96b2b3a866 -r 9e30cf6dcf96 graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Wed May 11 13:41:35 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Wed May 11 14:02:08 2011 +0200 @@ -990,12 +990,12 @@ lockAddress = new MonitorAddress(lockNumber, graph); append(lockAddress); } - frameState.push(CiKind.Object, x); MonitorEnter monitorEnter = new MonitorEnter(x, lockAddress, lockNumber, graph); - frameState.apop(); appendWithoutOptimization(monitorEnter, bci); frameState.lock(ir, x, lockNumber + 1); - monitorEnter.setStateAfter(frameState.create(bci)); + if (bci == Instruction.SYNCHRONIZATION_ENTRY_BCI) { + monitorEnter.setStateAfter(frameState.create(0)); + } killMemoryMap(); // prevent any optimizations across synchronization } @@ -1268,14 +1268,14 @@ end = (BlockEnd) lastInstr; break; } + stream.next(); + bci = stream.currentBCI(); if (lastInstr instanceof StateSplit) { StateSplit stateSplit = (StateSplit) lastInstr; if (stateSplit.stateAfter() == null && stateSplit.needsStateAfter()) { stateSplit.setStateAfter(frameState.create(bci)); } } - stream.next(); - bci = stream.currentBCI(); blockStart = false; }