changeset 11432:565724c714a7

Merge.
author Doug Simon <doug.simon@oracle.com>
date Mon, 26 Aug 2013 21:38:44 +0200
parents ca53d08b8ef9 ddbeefb142a7
children 7c2e47970d43
files
diffstat 6 files changed, 27 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/FrameAccessNode.java	Mon Aug 26 21:38:10 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/FrameAccessNode.java	Mon Aug 26 21:38:44 2013 +0200
@@ -34,6 +34,7 @@
 import com.oracle.graal.nodes.type.*;
 import com.oracle.graal.truffle.*;
 import com.oracle.graal.truffle.nodes.*;
+import com.oracle.graal.truffle.substitutions.*;
 import com.oracle.truffle.api.frame.*;
 
 /**
@@ -70,7 +71,7 @@
         return getConstantFrameSlot().getIndex();
     }
 
-    protected boolean isConstantFrameSlot() {
+    public boolean isConstantFrameSlot() {
         return slot.isConstant() && !slot.isNullConstant();
     }
 
@@ -113,14 +114,17 @@
     }
 
     protected final boolean isValidAccessKind() {
-        if (getSlotKind() == Kind.Byte) {
-            // tag access
+        if (isTagAccess()) {
             return true;
         }
 
         return getSlotKind() == getGraalKind(getConstantFrameSlot().getKind());
     }
 
+    protected final boolean isTagAccess() {
+        return field == FrameWithoutBoxingSubstitutions.TAGS_FIELD;
+    }
+
     private static Kind getGraalKind(FrameSlotKind kind) {
         switch (kind) {
             case Object:
@@ -156,6 +160,9 @@
     @Override
     public Map<Object, Object> getDebugProperties(Map<Object, Object> map) {
         Map<Object, Object> properties = super.getDebugProperties(map);
+        if (isTagAccess()) {
+            properties.put("slotKind", "Tag");
+        }
         if (isConstantFrameSlot()) {
             properties.put("frameSlot", getConstantFrameSlot().toString());
         }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/FrameGetNode.java	Mon Aug 26 21:38:10 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/FrameGetNode.java	Mon Aug 26 21:38:44 2013 +0200
@@ -78,12 +78,12 @@
         LoadFieldNode loadFieldNode = graph().add(new LoadFieldNode(getFrame(), field));
         structuredGraph.addBeforeFixed(this, loadFieldNode);
         FixedWithNextNode loadNode;
-        if (!getSlotKind().isPrimitive()) {
+        if (isTagAccess()) {
+            ValueNode slotIndex = getSlotOffset(1, tool.getRuntime());
+            loadNode = graph().add(new LoadIndexedNode(loadFieldNode, slotIndex, getSlotKind()));
+        } else if (!getSlotKind().isPrimitive()) {
             ValueNode slotIndex = getSlotOffset(1, tool.getRuntime());
             loadNode = graph().add(new LoadIndexedNode(loadFieldNode, slotIndex, Kind.Object));
-        } else if (getSlotKind() == Kind.Byte) {
-            ValueNode slotIndex = getSlotOffset(1, tool.getRuntime());
-            loadNode = graph().add(new LoadIndexedNode(loadFieldNode, slotIndex, Kind.Byte));
         } else {
             ValueNode slotOffset = getSlotOffset(Unsafe.ARRAY_LONG_INDEX_SCALE, tool.getRuntime());
             loadNode = graph().add(new UnsafeLoadNode(loadFieldNode, Unsafe.ARRAY_LONG_BASE_OFFSET, slotOffset, getSlotKind()));
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/FrameSetNode.java	Mon Aug 26 21:38:10 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/FrameSetNode.java	Mon Aug 26 21:38:44 2013 +0200
@@ -79,10 +79,10 @@
         structuredGraph.addBeforeFixed(this, loadFieldNode);
         FixedWithNextNode storeNode;
         ValueNode slotIndex = getSlotOffset(1, tool.getRuntime());
-        if (!getSlotKind().isPrimitive()) {
+        if (isTagAccess()) {
+            storeNode = graph().add(new StoreIndexedNode(loadFieldNode, slotIndex, getSlotKind(), value));
+        } else if (!getSlotKind().isPrimitive()) {
             storeNode = graph().add(new StoreIndexedNode(loadFieldNode, slotIndex, Kind.Object, value));
-        } else if (getSlotKind() == Kind.Byte) {
-            storeNode = graph().add(new StoreIndexedNode(loadFieldNode, slotIndex, Kind.Byte, value));
         } else {
             storeNode = graph().add(new StoreIndexedNode(loadFieldNode, slotIndex, Kind.Long, value));
         }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/phases/VerifyFrameDoesNotEscapePhase.java	Mon Aug 26 21:38:10 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/phases/VerifyFrameDoesNotEscapePhase.java	Mon Aug 26 21:38:44 2013 +0200
@@ -37,9 +37,8 @@
 
     @Override
     protected void run(StructuredGraph graph) {
-        NewFrameNode frame = graph.getNodes(NewFrameNode.class).first();
-        if (frame != null) {
-            for (MethodCallTargetNode callTarget : frame.usages().filter(MethodCallTargetNode.class)) {
+        for (NewFrameNode virtualFrame : graph.getNodes(NewFrameNode.class)) {
+            for (MethodCallTargetNode callTarget : virtualFrame.usages().filter(MethodCallTargetNode.class)) {
                 if (callTarget.invoke() != null) {
                     String properties = callTarget.getDebugProperties().toString();
                     String arguments = callTarget.arguments().toString();
@@ -47,6 +46,12 @@
                     throw GraphUtil.approxSourceException(callTarget, exception);
                 }
             }
+            for (FrameAccessNode frameAccess : virtualFrame.usages().filter(FrameAccessNode.class)) {
+                if (!frameAccess.isConstantFrameSlot()) {
+                    Throwable exception = new VerificationError("Frame slot must be compile-time constant in virtual frame access at: %s frameSlot=%s", frameAccess, frameAccess.getSlot());
+                    throw GraphUtil.approxSourceException(frameAccess, exception);
+                }
+            }
         }
     }
 }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/FrameWithoutBoxingSubstitutions.java	Mon Aug 26 21:38:10 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/FrameWithoutBoxingSubstitutions.java	Mon Aug 26 21:38:44 2013 +0200
@@ -36,7 +36,7 @@
 
     private static final ResolvedJavaField LOCALS_FIELD;
     private static final ResolvedJavaField PRIMITIVELOCALS_FIELD;
-    private static final ResolvedJavaField TAGS_FIELD;
+    public static final ResolvedJavaField TAGS_FIELD;
 
     static {
         try {
--- a/mx/commands.py	Mon Aug 26 21:38:10 2013 +0200
+++ b/mx/commands.py	Mon Aug 26 21:38:44 2013 +0200
@@ -680,7 +680,7 @@
 
     if cwd is None:
         cwd = _vm_cwd
-    elif _vm_cwd != cwd:
+    elif _vm_cwd is not None and _vm_cwd != cwd:
         mx.abort("conflicting working directories: do not set --vmcwd for this command")
 
     build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product'