# HG changeset patch # User Lukas Stadler # Date 1305892411 -7200 # Node ID 84f4c7dceb1465ea0f38d0e059ddf0c1db440829 # Parent 05c92e53a50d94574be80763a3c68cbd391f048a fixes for mergeOrClone move diff -r 05c92e53a50d -r 84f4c7dceb14 graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Fri May 20 13:20:21 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Fri May 20 13:53:31 2011 +0200 @@ -1048,6 +1048,7 @@ private void genTableswitch() { int bci = bci(); + Value value = frameState.ipop(); BytecodeTableSwitch ts = new BytecodeTableSwitch(stream(), bci); int max = ts.numberOfCases(); List list = new ArrayList(max + 1); @@ -1063,7 +1064,7 @@ list.add(createTargetAt(bci + offset, frameState)); boolean isSafepoint = isBackwards && !noSafepoints(); FrameState stateAfter = isSafepoint ? frameState.create(bci()) : null; - append(new TableSwitch(frameState.ipop(), (List) list, ts.lowKey(), stateAfter, graph)); + append(new TableSwitch(value, (List) list, ts.lowKey(), stateAfter, graph)); } private Instruction createTargetAt(int bci, FrameStateAccess stateAfter) { @@ -1078,6 +1079,7 @@ private void genLookupswitch() { int bci = bci(); + Value value = frameState.ipop(); BytecodeLookupSwitch ls = new BytecodeLookupSwitch(stream(), bci); int max = ls.numberOfCases(); List list = new ArrayList(max + 1); @@ -1095,7 +1097,7 @@ list.add(createTargetAt(bci + offset, frameState)); boolean isSafepoint = isBackwards && !noSafepoints(); FrameState stateAfter = isSafepoint ? frameState.create(bci()) : null; - append(new LookupSwitch(frameState.ipop(), (List) list, keys, stateAfter, graph)); + append(new LookupSwitch(value, (List) list, keys, stateAfter, graph)); } private Value appendConstant(CiConstant constant) { @@ -1213,7 +1215,8 @@ Block nextBlock = blockList[bci]; if (nextBlock != null && nextBlock != block) { // we fell through to the next block, add a goto and break - end = new Goto((BlockBegin) nextBlock.firstInstruction, null, graph); + Instruction next = createTarget(nextBlock, frameState); + end = new Goto((BlockBegin) next, null, graph); lastInstr = lastInstr.appendNext(end); break; }