diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java @ 9258:07f8d136a05e

Truffle API changes for the Frame API. Introduction of Assumptions class.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 23 Apr 2013 15:34:06 +0200
parents 1a2d258d481a
children e162d9e32830
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java	Tue Apr 23 15:08:11 2013 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java	Tue Apr 23 15:34:06 2013 +0200
@@ -46,7 +46,7 @@
      * @param slot the slot of the local variable
      * @return the current value of the local variable
      */
-    Object getObject(FrameSlot slot);
+    Object getObject(FrameSlot slot) throws FrameSlotTypeException;
 
     /**
      * Write access to a local variable of type {@link Object}.
@@ -54,7 +54,7 @@
      * @param slot the slot of the local variable
      * @param value the new value of the local variable
      */
-    void setObject(FrameSlot slot, Object value);
+    void setObject(FrameSlot slot, Object value) throws FrameSlotTypeException;
 
     /**
      * Read access to a local variable of type boolean.
@@ -62,7 +62,7 @@
      * @param slot the slot of the local variable
      * @return the current value of the local variable
      */
-    boolean getBoolean(FrameSlot slot);
+    boolean getBoolean(FrameSlot slot) throws FrameSlotTypeException;
 
     /**
      * Write access to a local variable of type boolean.
@@ -70,7 +70,7 @@
      * @param slot the slot of the local variable
      * @param value the new value of the local variable
      */
-    void setBoolean(FrameSlot slot, boolean value);
+    void setBoolean(FrameSlot slot, boolean value) throws FrameSlotTypeException;
 
     /**
      * Read access to a local variable of type int.
@@ -78,7 +78,7 @@
      * @param slot the slot of the local variable
      * @return the current value of the local variable
      */
-    int getInt(FrameSlot slot);
+    int getInt(FrameSlot slot) throws FrameSlotTypeException;
 
     /**
      * Write access to a local variable of type int.
@@ -86,7 +86,7 @@
      * @param slot the slot of the local variable
      * @param value the new value of the local variable
      */
-    void setInt(FrameSlot slot, int value);
+    void setInt(FrameSlot slot, int value) throws FrameSlotTypeException;
 
     /**
      * Read access to a local variable of type long.
@@ -94,7 +94,7 @@
      * @param slot the slot of the local variable
      * @return the current value of the local variable
      */
-    long getLong(FrameSlot slot);
+    long getLong(FrameSlot slot) throws FrameSlotTypeException;
 
     /**
      * Write access to a local variable of type long.
@@ -102,7 +102,7 @@
      * @param slot the slot of the local variable
      * @param value the new value of the local variable
      */
-    void setLong(FrameSlot slot, long value);
+    void setLong(FrameSlot slot, long value) throws FrameSlotTypeException;
 
     /**
      * Read access to a local variable of type float.
@@ -110,7 +110,7 @@
      * @param slot the slot of the local variable
      * @return the current value of the local variable
      */
-    float getFloat(FrameSlot slot);
+    float getFloat(FrameSlot slot) throws FrameSlotTypeException;
 
     /**
      * Write access to a local variable of type float.
@@ -118,7 +118,7 @@
      * @param slot the slot of the local variable
      * @param value the new value of the local variable
      */
-    void setFloat(FrameSlot slot, float value);
+    void setFloat(FrameSlot slot, float value) throws FrameSlotTypeException;
 
     /**
      * Read access to a local variable of type double.
@@ -126,7 +126,7 @@
      * @param slot the slot of the local variable
      * @return the current value of the local variable
      */
-    double getDouble(FrameSlot slot);
+    double getDouble(FrameSlot slot) throws FrameSlotTypeException;
 
     /**
      * Write access to a local variable of type double.
@@ -134,9 +134,15 @@
      * @param slot the slot of the local variable
      * @param value the new value of the local variable
      */
-    void setDouble(FrameSlot slot, double value);
+    void setDouble(FrameSlot slot, double value) throws FrameSlotTypeException;
 
-    void updateToLatestVersion();
+    /**
+     * Read access to a local variable of any type.
+     * 
+     * @param slot the slot of the local variable
+     * @return the current value of the local variable or defaultValue if unset
+     */
+    Object getValue(FrameSlot slot);
 
     /**
      * Converts this virtual frame into a packed frame that has no longer direct access to the local