comparison 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
comparison
equal deleted inserted replaced
9257:542712a4732a 9258:07f8d136a05e
44 * Read access to a local variable of type {@link Object}. 44 * Read access to a local variable of type {@link Object}.
45 * 45 *
46 * @param slot the slot of the local variable 46 * @param slot the slot of the local variable
47 * @return the current value of the local variable 47 * @return the current value of the local variable
48 */ 48 */
49 Object getObject(FrameSlot slot); 49 Object getObject(FrameSlot slot) throws FrameSlotTypeException;
50 50
51 /** 51 /**
52 * Write access to a local variable of type {@link Object}. 52 * Write access to a local variable of type {@link Object}.
53 * 53 *
54 * @param slot the slot of the local variable 54 * @param slot the slot of the local variable
55 * @param value the new value of the local variable 55 * @param value the new value of the local variable
56 */ 56 */
57 void setObject(FrameSlot slot, Object value); 57 void setObject(FrameSlot slot, Object value) throws FrameSlotTypeException;
58 58
59 /** 59 /**
60 * Read access to a local variable of type boolean. 60 * Read access to a local variable of type boolean.
61 * 61 *
62 * @param slot the slot of the local variable 62 * @param slot the slot of the local variable
63 * @return the current value of the local variable 63 * @return the current value of the local variable
64 */ 64 */
65 boolean getBoolean(FrameSlot slot); 65 boolean getBoolean(FrameSlot slot) throws FrameSlotTypeException;
66 66
67 /** 67 /**
68 * Write access to a local variable of type boolean. 68 * Write access to a local variable of type boolean.
69 * 69 *
70 * @param slot the slot of the local variable 70 * @param slot the slot of the local variable
71 * @param value the new value of the local variable 71 * @param value the new value of the local variable
72 */ 72 */
73 void setBoolean(FrameSlot slot, boolean value); 73 void setBoolean(FrameSlot slot, boolean value) throws FrameSlotTypeException;
74 74
75 /** 75 /**
76 * Read access to a local variable of type int. 76 * Read access to a local variable of type int.
77 * 77 *
78 * @param slot the slot of the local variable 78 * @param slot the slot of the local variable
79 * @return the current value of the local variable 79 * @return the current value of the local variable
80 */ 80 */
81 int getInt(FrameSlot slot); 81 int getInt(FrameSlot slot) throws FrameSlotTypeException;
82 82
83 /** 83 /**
84 * Write access to a local variable of type int. 84 * Write access to a local variable of type int.
85 * 85 *
86 * @param slot the slot of the local variable 86 * @param slot the slot of the local variable
87 * @param value the new value of the local variable 87 * @param value the new value of the local variable
88 */ 88 */
89 void setInt(FrameSlot slot, int value); 89 void setInt(FrameSlot slot, int value) throws FrameSlotTypeException;
90 90
91 /** 91 /**
92 * Read access to a local variable of type long. 92 * Read access to a local variable of type long.
93 * 93 *
94 * @param slot the slot of the local variable 94 * @param slot the slot of the local variable
95 * @return the current value of the local variable 95 * @return the current value of the local variable
96 */ 96 */
97 long getLong(FrameSlot slot); 97 long getLong(FrameSlot slot) throws FrameSlotTypeException;
98 98
99 /** 99 /**
100 * Write access to a local variable of type long. 100 * Write access to a local variable of type long.
101 * 101 *
102 * @param slot the slot of the local variable 102 * @param slot the slot of the local variable
103 * @param value the new value of the local variable 103 * @param value the new value of the local variable
104 */ 104 */
105 void setLong(FrameSlot slot, long value); 105 void setLong(FrameSlot slot, long value) throws FrameSlotTypeException;
106 106
107 /** 107 /**
108 * Read access to a local variable of type float. 108 * Read access to a local variable of type float.
109 * 109 *
110 * @param slot the slot of the local variable 110 * @param slot the slot of the local variable
111 * @return the current value of the local variable 111 * @return the current value of the local variable
112 */ 112 */
113 float getFloat(FrameSlot slot); 113 float getFloat(FrameSlot slot) throws FrameSlotTypeException;
114 114
115 /** 115 /**
116 * Write access to a local variable of type float. 116 * Write access to a local variable of type float.
117 * 117 *
118 * @param slot the slot of the local variable 118 * @param slot the slot of the local variable
119 * @param value the new value of the local variable 119 * @param value the new value of the local variable
120 */ 120 */
121 void setFloat(FrameSlot slot, float value); 121 void setFloat(FrameSlot slot, float value) throws FrameSlotTypeException;
122 122
123 /** 123 /**
124 * Read access to a local variable of type double. 124 * Read access to a local variable of type double.
125 * 125 *
126 * @param slot the slot of the local variable 126 * @param slot the slot of the local variable
127 * @return the current value of the local variable 127 * @return the current value of the local variable
128 */ 128 */
129 double getDouble(FrameSlot slot); 129 double getDouble(FrameSlot slot) throws FrameSlotTypeException;
130 130
131 /** 131 /**
132 * Write access to a local variable of type double. 132 * Write access to a local variable of type double.
133 * 133 *
134 * @param slot the slot of the local variable 134 * @param slot the slot of the local variable
135 * @param value the new value of the local variable 135 * @param value the new value of the local variable
136 */ 136 */
137 void setDouble(FrameSlot slot, double value); 137 void setDouble(FrameSlot slot, double value) throws FrameSlotTypeException;
138 138
139 void updateToLatestVersion(); 139 /**
140 * Read access to a local variable of any type.
141 *
142 * @param slot the slot of the local variable
143 * @return the current value of the local variable or defaultValue if unset
144 */
145 Object getValue(FrameSlot slot);
140 146
141 /** 147 /**
142 * Converts this virtual frame into a packed frame that has no longer direct access to the local 148 * Converts this virtual frame into a packed frame that has no longer direct access to the local
143 * variables. This packing is an important hint to the Truffle optimizer and therefore passing 149 * variables. This packing is an important hint to the Truffle optimizer and therefore passing
144 * around a {@link PackedFrame} should be preferred over passing around a {@link VirtualFrame} 150 * around a {@link PackedFrame} should be preferred over passing around a {@link VirtualFrame}