changeset 13885:eceacf66c44a

merge
author Christian Wimmer <christian.wimmer@oracle.com>
date Wed, 05 Feb 2014 04:54:01 -0800
parents edc9eb74bb7a (current diff) c6b1802ae32b (diff)
children 812f3155efba
files
diffstat 6 files changed, 31 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java	Wed Feb 05 03:17:05 2014 -0800
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java	Wed Feb 05 04:54:01 2014 -0800
@@ -639,6 +639,9 @@
         }
 
         private GuardingNode searchAnchor(ValueNode value, ResolvedJavaType type) {
+            if (!value.recordsUsages()) {
+                return null;
+            }
             for (Node n : value.usages()) {
                 if (n instanceof InstanceOfNode) {
                     InstanceOfNode instanceOfNode = (InstanceOfNode) n;
--- a/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FrameTest.java	Wed Feb 05 03:17:05 2014 -0800
+++ b/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FrameTest.java	Wed Feb 05 04:54:01 2014 -0800
@@ -37,7 +37,8 @@
  * {@link FrameDescriptor} represents the current structure of the frame. The method
  * {@link FrameDescriptor#addFrameSlot(Object, FrameSlotKind)} can be used to create predefined
  * frame slots. The setter and getter methods in the {@link Frame} class can be used to access the
- * current value of a particular frame slot.
+ * current value of a particular frame slot. Values can be removed from a frame via the
+ * {@link FrameDescriptor#removeFrameSlot(Object)} method.
  * </p>
  * 
  * <p>
@@ -64,11 +65,20 @@
     public void test() {
         TruffleRuntime runtime = Truffle.getRuntime();
         FrameDescriptor frameDescriptor = new FrameDescriptor();
-        FrameSlot slot = frameDescriptor.addFrameSlot("localVar", FrameSlotKind.Int);
+        String varName = "localVar";
+        FrameSlot slot = frameDescriptor.addFrameSlot(varName, FrameSlotKind.Int);
         TestRootNode rootNode = new TestRootNode(frameDescriptor, new AssignLocal(slot), new ReadLocal(slot));
         CallTarget target = runtime.createCallTarget(rootNode);
         Object result = target.call();
         Assert.assertEquals(42, result);
+        frameDescriptor.removeFrameSlot(varName);
+        boolean slotMissing = false;
+        try {
+            result = target.call();
+        } catch (IllegalArgumentException iae) {
+            slotMissing = true;
+        }
+        Assert.assertTrue(slotMissing);
     }
 
     class TestRootNode extends RootNode {
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/LoopCountReceiver.java	Wed Feb 05 03:17:05 2014 -0800
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/LoopCountReceiver.java	Wed Feb 05 04:54:01 2014 -0800
@@ -24,6 +24,10 @@
  */
 package com.oracle.truffle.api;
 
+/**
+ * Accepts the execution count of a loop that is a child of this node. The optimization heuristics
+ * can use the loop count to guide compilation and inlining.
+ */
 public interface LoopCountReceiver {
 
     void reportLoopCount(int count);
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ReplaceObserver.java	Wed Feb 05 03:17:05 2014 -0800
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ReplaceObserver.java	Wed Feb 05 04:54:01 2014 -0800
@@ -24,6 +24,9 @@
  */
 package com.oracle.truffle.api;
 
+/**
+ * An observer that is notified whenever a child node is replaced.
+ */
 public interface ReplaceObserver {
 
     void nodeReplaced();
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java	Wed Feb 05 03:17:05 2014 -0800
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java	Wed Feb 05 04:54:01 2014 -0800
@@ -33,7 +33,7 @@
 public class TruffleOptions {
 
     /**
-     * Enables/disables the rewriting of traces in the truffle runtime to stdout.
+     * Enables/disables the rewriting of traces in the Truffle runtime to stdout.
      * <p>
      * Can be set with {@code -Dtruffle.TraceRewrites=true}.
      */
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameDescriptor.java	Wed Feb 05 03:17:05 2014 -0800
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameDescriptor.java	Wed Feb 05 04:54:01 2014 -0800
@@ -86,6 +86,14 @@
         return addFrameSlot(identifier, kind);
     }
 
+    public void removeFrameSlot(Object identifier) {
+        assert identifierToSlotMap.containsKey(identifier);
+        slots.remove(identifierToSlotMap.get(identifier));
+        identifierToSlotMap.remove(identifier);
+        updateVersion();
+        getNotInFrameAssumption(identifier);
+    }
+
     public int getSize() {
         return slots.size();
     }