# HG changeset patch # User Lukas Stadler # Date 1305195197 -7200 # Node ID 32e8315bb6e41951f7b7c0cbe75d4ae65c0fdfba # Parent c4922e69711e2c67c5351ceee3e006fd93da8843 fixed slot encoding in duplicateModified diff -r c4922e69711e -r 32e8315bb6e4 graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Thu May 12 11:17:31 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Thu May 12 12:13:17 2011 +0200 @@ -976,6 +976,7 @@ } private FrameState stateBeforeRegisterFinalizer(RegisterFinalizer rf) { + assert rf.object().kind == CiKind.Object; return rf.stateAfter().duplicateModified(rf.bci(), CiKind.Void, rf.object()); } diff -r c4922e69711e -r 32e8315bb6e4 graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java --- a/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Thu May 12 11:17:31 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Thu May 12 12:13:17 2011 +0200 @@ -118,14 +118,12 @@ /** * Creates a copy of this frame state with one stack element of type popKind popped from the stack and the - * values in pushedValues pushed on the stack. + * values in pushedValues pushed on the stack. The pushedValues are expected to be in slot encoding: a long + * or double is followed by a null slot. */ public FrameState duplicateModified(int bci, CiKind popKind, Value... pushedValues) { int popSlots = popKind.sizeInSlots(); - int pushSlots = 0; - for (Value v : pushedValues) { - pushSlots += v.kind.sizeInSlots(); - } + int pushSlots = pushedValues.length; FrameState other = new FrameState(bci, localsSize, stackSize - popSlots + pushSlots, locksSize(), graph()); for (int i = 0; i < localsSize; i++) { other.inputs().set(i, localAt(i)); @@ -133,16 +131,12 @@ for (int i = 0; i < stackSize - popSlots; i++) { other.inputs().set(localsSize + i, stackAt(i)); } - int slot = stackSize - popSlots; - for (Value v : pushedValues) { - assert v.kind.sizeInSlots() > 0; - if (v.kind.sizeInSlots() == 2) { - other.inputs().set(localsSize + slot++, null); - } - other.inputs().set(localsSize + slot++, v); + int slot = localsSize + stackSize - popSlots; + for (int i = 0; i < pushSlots; i++) { + other.inputs().set(slot++, pushedValues[i]); } for (int i = 0; i < locksSize; i++) { - other.inputs().set(localsSize + i, lockAt(i)); + other.inputs().set(localsSize + other.stackSize + i, lockAt(i)); } return other; }