Class LocalRangeAccessor
java.lang.Object
com.oracle.truffle.api.bytecode.LocalRangeAccessor
Operation parameter that allows an operation to get, set, or clear locals declared in a
contiguous range.
To use a local range accessor, declare a ConstantOperand on the operation. The
corresponding builder method for the operation will take a BytecodeLocal array argument
for the locals to be accessed. These locals must be allocated sequentially during building. At
run time, a LocalRangeAccessor for the locals will be supplied as a parameter to the
operation.
All of the accessor methods take a BytecodeNode, the current Frame, and an
offset. The offset should be a valid compilation-final index into the array of locals. See the
LocalAccessor javadoc for restrictions on the other parameters and usage recommendations.
- Since:
- 24.2
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Clears the local at the given offset into the range.static LocalRangeAccessorconstantOf(BytecodeLocal[] locals) Obtains aLocalRangeAccessor.booleanbooleangetBoolean(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Loads a boolean from the local at the given offset into the range.bytegetByte(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Loads a byte from the local at the given offset into the range.doublegetDouble(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Loads a double from the local at the given offset into the range.floatgetFloat(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Loads a float from the local at the given offset into the range.intgetInt(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Loads an int from the local at the given offset into the range.intReturns the length of the range.getLocalInfo(BytecodeNode bytecodeNode, int offset) Returns the info associated with the local.getLocalName(BytecodeNode bytecodeNode, int offset) Returns the name associated with the local.longgetLong(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Loads a long from the local at the given offset into the range.getObject(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Loads an object from the local at the given offset into the range.inthashCode()booleanisCleared(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) Checks whether the local at the given offset into the range has beencleared(and a new value has not been set).voidsetBoolean(BytecodeNode bytecodeNode, VirtualFrame frame, int offset, boolean value) Stores a boolean into the local at the given offset into the range.voidsetByte(BytecodeNode bytecodeNode, VirtualFrame frame, int offset, byte value) Stores a byte into the local at the given offset into the range.voidsetDouble(BytecodeNode bytecodeNode, VirtualFrame frame, int offset, double value) Stores a double into the local at the given offset into the range.voidsetFloat(BytecodeNode bytecodeNode, VirtualFrame frame, int offset, float value) Stores a float into the local at the given offset into the range.voidsetInt(BytecodeNode bytecodeNode, VirtualFrame frame, int offset, int value) Stores an int into the local at the given offset into the range.voidsetLong(BytecodeNode bytecodeNode, VirtualFrame frame, int offset, long value) Stores a long into the local at the given offset into the range.voidsetObject(BytecodeNode bytecodeNode, VirtualFrame frame, int offset, Object value) Stores an object into the local at the given offset into the range.toString()Returns a string representation of aLocalRangeAccessor.
-
Method Details
-
getLength
public int getLength()Returns the length of the range.- Since:
- 24.2
-
hashCode
-
equals
-
toString
Returns a string representation of aLocalRangeAccessor. -
getObject
Loads an object from the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
-
getBoolean
public boolean getBoolean(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a boolean from the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getByte
public byte getByte(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a byte from the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getInt
public int getInt(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads an int from the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getLong
public long getLong(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a long from the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getFloat
public float getFloat(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a float from the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getDouble
public double getDouble(BytecodeNode bytecodeNode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a double from the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
setObject
Stores an object into the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
-
setBoolean
Stores a boolean into the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
-
setByte
Stores a byte into the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
-
setInt
Stores an int into the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
-
setLong
Stores a long into the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
-
setFloat
Stores a float into the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
-
setDouble
Stores a double into the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
-
clear
Clears the local at the given offset into the range.- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
- See Also:
-
isCleared
Checks whether the local at the given offset into the range has beencleared(and a new value has not been set).- Parameters:
offset- a partial evaluation constant offset into the range.- Since:
- 24.2
- See Also:
-
getLocalName
Returns the name associated with the local.- Since:
- 24.2
- See Also:
-
getLocalInfo
Returns the info associated with the local.- Since:
- 24.2
- See Also:
-
constantOf
Obtains aLocalRangeAccessor. This method is invoked by the generated code and should not be called directly.- Since:
- 24.2
-