Package com.oracle.truffle.api.bytecode
Class LocalRangeAccessor
java.lang.Object
com.oracle.truffle.api.bytecode.LocalRangeAccessor
Operation parameter that allows an operation to update a contiguous range of locals. This class
is intended to be used in combination with the
ConstantOperand annotation.
When a local setter range is declared as a constant operand, the corresponding builder method
will take a BytecodeLocal array argument representing the locals to be updated.
- Since:
- 24.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalRangeAccessorconstantOf(BytecodeLocal[] locals) Creates a local setter range given an array of bytecode locals created by the builder.booleanbooleangetBoolean(BytecodeNode bytecode, VirtualFrame frame, int offset) Loads a boolean from a local at the given offset into the range.bytegetByte(BytecodeNode bytecode, VirtualFrame frame, int offset) Loads a byte from a local at the given offset into the range.doublegetDouble(BytecodeNode bytecode, VirtualFrame frame, int offset) Loads a double from a local at the given offset into the range.floatgetFloat(BytecodeNode bytecode, VirtualFrame frame, int offset) Loads a float from a local at the given offset into the range.intgetInt(BytecodeNode bytecode, VirtualFrame frame, int offset) Loads an int from a local at the given offset into the range.intReturns the length of the range.longgetLong(BytecodeNode bytecode, VirtualFrame frame, int offset) Loads a long from a local at the given offset into the range.getObject(BytecodeNode bytecode, VirtualFrame frame, int offset) Loads an object from a local at the given offset into the range.inthashCode()voidsetBoolean(BytecodeNode bytecode, VirtualFrame frame, int offset, boolean value) Stores a boolean into the local at the given offset into the range.voidsetByte(BytecodeNode bytecode, VirtualFrame frame, int offset, byte value) Stores a byte into the local at the given offset into the range.voidsetDouble(BytecodeNode bytecode, VirtualFrame frame, int offset, double value) Stores a double into the local at the given offset into the range.voidsetFloat(BytecodeNode bytecode, VirtualFrame frame, int offset, float value) Stores a float into the local at the given offset into the range.voidsetInt(BytecodeNode bytecode, VirtualFrame frame, int offset, int value) Stores an int into the local at the given offset into the range.voidsetLong(BytecodeNode bytecode, VirtualFrame frame, int offset, long value) Stores a long into the local at the given offset into the range.voidsetObject(BytecodeNode bytecode, 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
public int hashCode() -
equals
-
toString
Returns a string representation of aLocalRangeAccessor. -
getObject
Loads an object from a local at the given offset into the range.- Since:
- 24.2
-
getBoolean
public boolean getBoolean(BytecodeNode bytecode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a boolean from a local at the given offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getByte
public byte getByte(BytecodeNode bytecode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a byte from a local at the given offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getInt
public int getInt(BytecodeNode bytecode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads an int from a local at the given offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getLong
public long getLong(BytecodeNode bytecode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a long from a local at the given offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getFloat
public float getFloat(BytecodeNode bytecode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a float from a local at the given offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
getDouble
public double getDouble(BytecodeNode bytecode, VirtualFrame frame, int offset) throws UnexpectedResultException Loads a double from a local at the given offset into the range.- Throws:
UnexpectedResultException- Since:
- 24.2
-
setObject
Stores an object into the local at the given offset into the range.- Since:
- 24.2
-
setInt
Stores an int into the local at the given offset into the range.- Since:
- 24.2
-
setLong
Stores a long into the local at the given offset into the range.- Since:
- 24.2
-
setBoolean
Stores a boolean into the local at the given offset into the range.- Since:
- 24.2
-
setByte
Stores a byte into the local at the given offset into the range.- Since:
- 24.2
-
setFloat
Stores a float into the local at the given offset into the range.- Since:
- 24.2
-
setDouble
Stores a double into the local at the given offset into the range.- Since:
- 24.2
-
constantOf
Creates a local setter range given an array of bytecode locals created by the builder. The array of bytecode locals must locals with consective localOffset. The returned value may return an interned instance ofLocalRangeAccessorto improve memory footprint.- Since:
- 24.2
-