Mercurial > hg > graal-jvmci-8
diff graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java @ 2581:4a36a0bd6d18
added GraalGraph to classpath, Node as superclass of Value
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 05 May 2011 13:27:48 +0200 |
parents | 46586c77b129 |
children | 768d77a1c7af |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Wed May 04 18:57:26 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Thu May 05 13:27:48 2011 +0200 @@ -110,10 +110,7 @@ final MutableFrameState other = new MutableFrameState(bci, localsSize(), maxStackSize()); if (withLocals && withStack) { // fast path: use array copy - int valuesSize = valuesSize(); - assert other.values.length >= valuesSize : "array size: " + other.values.length + ", valuesSize: " + valuesSize + ", maxStackSize: " + maxStackSize() + ", localsSize: " + localsSize(); - assert values.length >= valuesSize : "array size: " + values.length + ", valuesSize: " + valuesSize + ", maxStackSize: " + maxStackSize() + ", localsSize: " + localsSize(); - System.arraycopy(values, 0, other.values, 0, valuesSize); + System.arraycopy(values, 0, other.values, 0, valuesSize()); other.stackIndex = stackIndex; } else { if (withLocals) { @@ -150,10 +147,10 @@ return copy(bci, false, false, false); } - public boolean isSame(FrameState other) { - assert stackSize() == other.stackSize(); - assert localsSize() == other.localsSize(); - assert locksSize() == other.locksSize(); + public boolean isCompatibleWith(FrameState other) { + if (stackSize() != other.stackSize() || localsSize() != other.localsSize() || locksSize() != other.locksSize()) { + return false; + } for (int i = 0; i < stackIndex; i++) { Value x = stackAt(i); Value y = other.stackAt(i);