Class LocalAccessor

java.lang.Object
com.oracle.truffle.api.bytecode.LocalAccessor

public final class LocalAccessor extends Object
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