Package com.oracle.truffle.api.frame
Interface Frame
-
- All Known Subinterfaces:
MaterializedFrame,VirtualFrame
public interface FrameRepresents a frame containing values of local variables of the guest language. Instances of this type must not be stored in a field or cast toObject.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object[]getArguments()Retrieves the arguments object from this frame.booleangetBoolean(FrameSlot slot)Read access to a local variable of type boolean.bytegetByte(FrameSlot slot)Read access to a local variable of type byte.doublegetDouble(FrameSlot slot)Read access to a local variable of type double.floatgetFloat(FrameSlot slot)Read access to a local variable of type float.FrameDescriptorgetFrameDescriptor()intgetInt(FrameSlot slot)Read access to a local variable of type int.longgetLong(FrameSlot slot)Read access to a local variable of type long.java.lang.ObjectgetObject(FrameSlot slot)Read access to a local variable of typeObject.java.lang.ObjectgetValue(FrameSlot slot)Read access to a local variable of any type.booleanisBoolean(FrameSlot slot)Check whether the givenFrameSlotis of type boolean.booleanisByte(FrameSlot slot)Check whether the givenFrameSlotis of type byte.booleanisDouble(FrameSlot slot)Check whether the givenFrameSlotis of type double.booleanisFloat(FrameSlot slot)Check whether the givenFrameSlotis of type float.booleanisInt(FrameSlot slot)Check whether the givenFrameSlotis of type int.booleanisLong(FrameSlot slot)Check whether the givenFrameSlotis of type long.booleanisObject(FrameSlot slot)Check whether the givenFrameSlotis of type object.MaterializedFramematerialize()Materializes this frame, which allows it to be stored in a field or cast toObject.voidsetBoolean(FrameSlot slot, boolean value)Write access to a local variable of type boolean.voidsetByte(FrameSlot slot, byte value)Write access to a local variable of type byte.voidsetDouble(FrameSlot slot, double value)Write access to a local variable of type double.voidsetFloat(FrameSlot slot, float value)Write access to a local variable of type float.voidsetInt(FrameSlot slot, int value)Write access to a local variable of type int.voidsetLong(FrameSlot slot, long value)Write access to a local variable of type long.voidsetObject(FrameSlot slot, java.lang.Object value)Write access to a local variable of typeObject.
-
-
-
Method Detail
-
getFrameDescriptor
FrameDescriptor getFrameDescriptor()
- Returns:
- the object describing the layout of this frame
-
getArguments
java.lang.Object[] getArguments()
Retrieves the arguments object from this frame. The runtime assumes that the arguments object is never null.- Returns:
- the arguments used when calling this method
-
getObject
java.lang.Object getObject(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of typeObject.- Parameters:
slot- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setObject
void setObject(FrameSlot slot, java.lang.Object value)
Write access to a local variable of typeObject.- Parameters:
slot- the slot of the local variablevalue- the new value of the local variable
-
getByte
byte getByte(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type byte.- Parameters:
slot- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setByte
void setByte(FrameSlot slot, byte value)
Write access to a local variable of type byte.- Parameters:
slot- the slot of the local variablevalue- the new value of the local variable
-
getBoolean
boolean getBoolean(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type boolean.- Parameters:
slot- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setBoolean
void setBoolean(FrameSlot slot, boolean value)
Write access to a local variable of type boolean.- Parameters:
slot- the slot of the local variablevalue- the new value of the local variable
-
getInt
int getInt(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type int.- Parameters:
slot- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setInt
void setInt(FrameSlot slot, int value)
Write access to a local variable of type int.- Parameters:
slot- the slot of the local variablevalue- the new value of the local variable
-
getLong
long getLong(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type long.- Parameters:
slot- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setLong
void setLong(FrameSlot slot, long value)
Write access to a local variable of type long.- Parameters:
slot- the slot of the local variablevalue- the new value of the local variable
-
getFloat
float getFloat(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type float.- Parameters:
slot- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setFloat
void setFloat(FrameSlot slot, float value)
Write access to a local variable of type float.- Parameters:
slot- the slot of the local variablevalue- the new value of the local variable
-
getDouble
double getDouble(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type double.- Parameters:
slot- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setDouble
void setDouble(FrameSlot slot, double value)
Write access to a local variable of type double.- Parameters:
slot- the slot of the local variablevalue- the new value of the local variable
-
getValue
java.lang.Object getValue(FrameSlot slot)
Read access to a local variable of any type.- Parameters:
slot- the slot of the local variable- Returns:
- the current value of the local variable or defaultValue if unset
-
materialize
MaterializedFrame materialize()
Materializes this frame, which allows it to be stored in a field or cast toObject. The frame however looses the ability to be packed or to access the caller frame.- Returns:
- the new materialized frame
-
-