changeset 13860:82090a107bae

make sure pushed values are formatted correctly
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Mon, 03 Feb 2014 17:16:52 -0800
parents 1e01e2644a5d
children b77c09786445
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java	Mon Feb 03 10:43:11 2014 -0800
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java	Mon Feb 03 17:16:52 2014 -0800
@@ -244,8 +244,8 @@
 
     /**
      * 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. The pushedValues are expected to be
-     * in slot encoding: a long or double is followed by a null slot.
+     * stack and the values in pushedValues pushed on the stack. The pushedValues will be formatted
+     * correctly in slot encoding: a long or double will be followed by a null slot.
      */
     public FrameState duplicateModified(int newBci, boolean newRethrowException, Kind popKind, ValueNode... pushedValues) {
         ArrayList<ValueNode> copy = new ArrayList<>(values.subList(0, localsSize + stackSize));
@@ -257,7 +257,12 @@
             assert lastSlot.kind().getStackKind() == popKind.getStackKind();
             copy.remove(copy.size() - 1);
         }
-        Collections.addAll(copy, pushedValues);
+        for (ValueNode node : pushedValues) {
+            copy.add(node);
+            if (node.kind() == Kind.Long || node.kind() == Kind.Double) {
+                copy.add(null);
+            }
+        }
         int newStackSize = copy.size() - localsSize;
         copy.addAll(values.subList(localsSize + stackSize, values.size()));