changeset 9280:c62bf8be5caf

Merge.
author Christian Humer <christian.humer@gmail.com>
date Wed, 24 Apr 2013 17:44:57 +0200
parents 2a4b57f02fb4 (current diff) 8cf939b349dd (diff)
children e16363e50252
files
diffstat 5 files changed, 22 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java	Wed Apr 24 17:44:15 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java	Wed Apr 24 17:44:57 2013 +0200
@@ -43,13 +43,14 @@
     private ConstantNode getConstantCallTarget(MetaAccessProvider metaAccessProvider, Assumptions assumptions) {
         if (getCallSite().isConstant() && !getCallSite().isNullConstant()) {
             CallSite callSite = (CallSite) getCallSite().asConstant().asObject();
-            if (callSite instanceof ConstantCallSite) {
-                return ConstantNode.forObject(callSite.getTarget(), metaAccessProvider, graph());
-            } else if (callSite instanceof MutableCallSite || callSite instanceof VolatileCallSite && assumptions != null && assumptions.useOptimisticAssumptions()) {
-                MethodHandle target = callSite.getTarget();
+            MethodHandle target = callSite.getTarget();
+            if (!(callSite instanceof ConstantCallSite)) {
+                if (assumptions == null || !assumptions.useOptimisticAssumptions()) {
+                    return null;
+                }
                 assumptions.record(new Assumptions.CallSiteTargetValue(callSite, target));
-                return ConstantNode.forObject(target, metaAccessProvider, graph());
             }
+            return ConstantNode.forObject(target, metaAccessProvider, graph());
         }
         return null;
     }
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultVirtualFrame.java	Wed Apr 24 17:44:15 2013 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultVirtualFrame.java	Wed Apr 24 17:44:57 2013 +0200
@@ -156,8 +156,13 @@
     }
 
     private void verifySet(FrameSlot slot, Class accessType) throws FrameSlotTypeException {
-        if (slot.getType() != accessType) {
-            throw new FrameSlotTypeException();
+        Class<?> slotType = slot.getType();
+        if (slotType != accessType) {
+            if (slotType == null) {
+                slot.setType(accessType);
+            } else {
+                throw new FrameSlotTypeException();
+            }
         }
         int slotIndex = slot.getIndex();
         if (slotIndex >= tags.length) {
@@ -168,25 +173,21 @@
 
     private void verifyGet(FrameSlot slot, Class accessType) throws FrameSlotTypeException {
         Class<?> slotType = slot.getType();
-        int slotIndex = slot.getIndex();
         if (slotType != accessType) {
-            if (slotType == null) {
+            if (slotType == null && accessType == Object.class) {
                 slot.setType(Object.class);
                 this.setObject(slot, descriptor.getTypeConversion().getDefaultValue());
-                if (accessType != Object.class) {
-                    throw new FrameSlotTypeException();
-                }
             } else {
                 throw new FrameSlotTypeException();
             }
         }
+        int slotIndex = slot.getIndex();
         if (slotIndex >= tags.length) {
             resize();
         }
-        Class tag = tags[slotIndex];
-        if (tag != slotType) {
+        if (tags[slotIndex] != accessType) {
             descriptor.getTypeConversion().updateFrameSlot(this, slot, getValue(slot));
-            if (tags[slotIndex] != slotType) {
+            if (tags[slotIndex] != accessType) {
                 throw new FrameSlotTypeException();
             }
         }
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java	Wed Apr 24 17:44:15 2013 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java	Wed Apr 24 17:44:57 2013 +0200
@@ -100,9 +100,6 @@
             this.parentOffset = parentOffsetTemp;
         }
 
-        /**
-         * (db) getters added to support AST cloning for parallel execution.
-         */
         public long getParentOffset() {
             return parentOffset;
         }
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/NodeFactory.java	Wed Apr 24 17:44:15 2013 +0200
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/NodeFactory.java	Wed Apr 24 17:44:57 2013 +0200
@@ -59,7 +59,7 @@
     }
 
     public TypedNode createLocal(String name) {
-        return ReadLocalNodeFactory.create(frameDescriptor.findOrAddFrameSlot(name, Integer.class));
+        return ReadLocalNodeFactory.create(frameDescriptor.findOrAddFrameSlot(name, int.class));
     }
 
     public TypedNode createStringLiteral(String value) {
@@ -67,7 +67,7 @@
     }
 
     public StatementNode createAssignment(String name, TypedNode right) {
-        return WriteLocalNodeFactory.create(frameDescriptor.findOrAddFrameSlot(name, Integer.class), right);
+        return WriteLocalNodeFactory.create(frameDescriptor.findOrAddFrameSlot(name, int.class), right);
     }
 
     public StatementNode createPrint(List<TypedNode> expressions) {
@@ -123,7 +123,7 @@
     }
 
     public StatementNode createReturn(TypedNode value) {
-        FrameSlot slot = frameDescriptor.findOrAddFrameSlot("<retval>", Integer.class);
+        FrameSlot slot = frameDescriptor.findOrAddFrameSlot("<retval>", int.class);
         if (returnValue == null) {
             returnValue = ReadLocalNodeFactory.create(slot);
         }
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/WriteLocalNode.java	Wed Apr 24 17:44:15 2013 +0200
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/WriteLocalNode.java	Wed Apr 24 17:44:57 2013 +0200
@@ -38,29 +38,13 @@
 
     @Specialization(rewriteOn = FrameSlotTypeException.class)
     public int write(VirtualFrame frame, int right) throws FrameSlotTypeException {
-        try {
-            frame.setInt(slot, right);
-        } catch (FrameSlotTypeException e) {
-            if (slot.getType() == null) {
-                FrameUtil.setIntSafe(frame, slot, right);
-            } else {
-                throw e;
-            }
-        }
+        frame.setInt(slot, right);
         return right;
     }
 
     @Specialization(rewriteOn = FrameSlotTypeException.class)
     public boolean write(VirtualFrame frame, boolean right) throws FrameSlotTypeException {
-        try {
-            frame.setBoolean(slot, right);
-        } catch (FrameSlotTypeException e) {
-            if (slot.getType() == null) {
-                FrameUtil.setBooleanSafe(frame, slot, right);
-            } else {
-                throw e;
-            }
-        }
+        frame.setBoolean(slot, right);
         return right;
     }