Package com.oracle.truffle.api.frame
Interface Frame
- All Known Subinterfaces:
MaterializedFrame,VirtualFrame
public interface Frame
Represents a frame containing values of local variables of the guest language. Instances of this
type must not be stored in a field or cast to
Object.-
Method Summary
Modifier and TypeMethodDescriptionObject[]Retrieves the arguments object from this frame.booleangetBoolean(FrameSlot slot) Read access to a local variable of type boolean.byteRead access to a local variable of type byte.doubleRead access to a local variable of type double.floatRead access to a local variable of type float.intRead access to a local variable of type int.longRead access to a local variable of type long.Read access to a local variable of typeObject.Read access to a local variable of any type.booleanCheck whether the givenFrameSlotis of type boolean.booleanCheck whether the givenFrameSlotis of type byte.booleanCheck whether the givenFrameSlotis of type double.booleanCheck whether the givenFrameSlotis of type float.booleanCheck whether the givenFrameSlotis of type int.booleanCheck whether the givenFrameSlotis of type long.booleanCheck whether the givenFrameSlotis of type object.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.voidWrite access to a local variable of type byte.voidWrite access to a local variable of type double.voidWrite access to a local variable of type float.voidWrite access to a local variable of type int.voidWrite access to a local variable of type long.voidWrite access to a local variable of typeObject.
-
Method Details
-
getFrameDescriptor
FrameDescriptor getFrameDescriptor()- Returns:
- the object describing the layout of this frame
-
getArguments
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
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
Write access to a local variable of typeObject.- Parameters:
slot- the slot of the local variablevalue- the new value of the local variable
-
getByte
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
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
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
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
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
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
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
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
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
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
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
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
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
-
isObject
Check whether the givenFrameSlotis of type object. -
isByte
Check whether the givenFrameSlotis of type byte. -
isBoolean
Check whether the givenFrameSlotis of type boolean. -
isInt
Check whether the givenFrameSlotis of type int. -
isLong
Check whether the givenFrameSlotis of type long. -
isFloat
Check whether the givenFrameSlotis of type float. -
isDouble
Check whether the givenFrameSlotis of type double.
-