# HG changeset patch # User Lukas Stadler # Date 1368720726 -7200 # Node ID 0dd573144b5b166e251bb371c74de394b4557acc # Parent 8ba0e5cab309f1e92e7ff87d45bfcdb9338426b6 allow only .isAlive() nodes to be added to a FrameStateBuilder diff -r 8ba0e5cab309 -r 0dd573144b5b graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Thu May 16 18:05:42 2013 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Thu May 16 18:12:06 2013 +0200 @@ -358,6 +358,7 @@ * @param object the object whose monitor will be locked. */ public void pushLock(ValueNode object) { + assert object.isAlive() && object.kind() == Kind.Object : "unexpected value: " + object; locks = Arrays.copyOf(locks, locks.length + 1); locks[locks.length - 1] = object; } @@ -406,7 +407,7 @@ * @param x the instruction which produces the value for the local */ public void storeLocal(int i, ValueNode x) { - assert x == null || x.kind() != Kind.Void && x.kind() != Kind.Illegal : "unexpected value: " + x; + assert x == null || x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal : "unexpected value: " + x; locals[i] = x; if (x != null && isTwoSlot(x.kind())) { // if this is a double word, then kill i+1 @@ -422,7 +423,7 @@ } private void storeStack(int i, ValueNode x) { - assert x == null || stack[i] == null || x.kind() == stack[i].kind() : "Method does not handle changes from one-slot to two-slot values"; + assert x == null || x.isAlive() && (stack[i] == null || x.kind() == stack[i].kind()) : "Method does not handle changes from one-slot to two-slot values or non-alive values"; stack[i] = x; } @@ -433,7 +434,7 @@ * @param x the instruction to push onto the stack */ public void push(Kind kind, ValueNode x) { - assert !x.isDeleted() && x.kind() != Kind.Void && x.kind() != Kind.Illegal; + assert x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal; xpush(assertKind(kind, x)); if (isTwoSlot(kind)) { xpush(null); @@ -446,7 +447,7 @@ * @param x the instruction to push onto the stack */ public void xpush(ValueNode x) { - assert x == null || (!x.isDeleted() && x.kind() != Kind.Void && x.kind() != Kind.Illegal); + assert x == null || (x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal); stack[stackSize++] = x; }