Package com.oracle.truffle.api.bytecode
Class LocalAccessor
java.lang.Object
com.oracle.truffle.api.bytecode.LocalAccessor
Operation parameter that allows an operation to get and set the value of a local. This class is
intended to be used in combination with the
ConstantOperand annotation.
When a local accessor is declared as a constant operand, the corresponding builder method will
take a BytecodeLocal argument representing the local to be updated. Whenever possible
using LocalAccessor should be preferred over
BytecodeNode.getLocalValue(int, Frame, int) and builtin operations should be preferred
over using LocalAccessor.
Example usage:
@Operation
@ConstantOperand(type = LocalAccessor.class)
public static final class GetLocalAccessor {
@Specialization
public static Object perform(VirtualFrame frame, LocalAccessor accessor,- Since:
- 24.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalAccessorconstantOf(BytecodeLocal local) Obtains an existingLocalAccessor.booleanbooleangetBoolean(BytecodeNode node, VirtualFrame frame) Loads a boolean from a local.bytegetByte(BytecodeNode node, VirtualFrame frame) Loads a byte from a local.doublegetDouble(BytecodeNode node, VirtualFrame frame) Loads a double from a local.floatgetFloat(BytecodeNode node, VirtualFrame frame) Loads a float from a local.intgetInt(BytecodeNode node, VirtualFrame frame) Loads an int from a local.longgetLong(BytecodeNode node, VirtualFrame frame) Loads a long from a local.getObject(BytecodeNode node, VirtualFrame frame) Loads an Object from a local.inthashCode()voidsetBoolean(BytecodeNode node, VirtualFrame frame, boolean value) Stores a short into the local.voidsetByte(BytecodeNode node, VirtualFrame frame, byte value) Stores a short into the local.voidsetDouble(BytecodeNode node, VirtualFrame frame, double value) Stores a double into the local.voidsetFloat(BytecodeNode node, VirtualFrame frame, float value) Stores a float into the local.voidsetInt(BytecodeNode node, VirtualFrame frame, int value) Stores an int into the local.voidsetLong(BytecodeNode node, VirtualFrame frame, long value) Stores a long into the local.voidsetObject(BytecodeNode node, VirtualFrame frame, Object value) Stores an object into the local.toString()Returns a string representation of aLocalAccessor.
-
Method Details
-
toString
Returns a string representation of aLocalAccessor. -
setObject
Stores an object into the local.- Since:
- 24.2
-
setInt
Stores an int into the local.- Since:
- 24.2
-
setLong
Stores a long into the local.- Since:
- 24.2
-
setBoolean
Stores a short into the local.- Since:
- 24.2
- See Also:
-
setByte
Stores a short into the local.- Since:
- 24.2
- See Also:
-
setFloat
Stores a float into the local.- Since:
- 24.2
-
setDouble
Stores a double into the local.- Since:
- 24.2
-
getObject
Loads an Object from a local.- Since:
- 24.2
-
getBoolean
Loads a boolean from a local.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getByte
Loads a byte from a local.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getInt
Loads an int from a local.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getLong
Loads a long from a local.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getFloat
Loads a float from a local.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getDouble
Loads a double from a local.- Throws:
UnexpectedResultException- Since:
- 24.2
-
constantOf
Obtains an existingLocalAccessor. This method is invoked by the generated code and should not be called directly.- Since:
- 24.2
-
equals
-
hashCode
public int hashCode()
-