Interface StoreInstruction

All Superinterfaces:
ClassFileElement, CodeElement, Instruction

public sealed interface StoreInstruction extends Instruction
Models a local variable store instruction in the code array of a Code attribute. Corresponding opcodes will have a kind of Opcode.Kind.STORE. Delivered as a CodeElement when traversing the elements of a CodeModel.
Since:
24
  • Method Summary

    Modifier and Type
    Method
    Description
    of(Opcode op, int slot)
    Returns a local variable store instruction.
    of(TypeKind kind, int slot)
    Returns a local variable store instruction.
    int
    Returns the local variable slot to store to.
    Returns the type of the value to be stored.

    Methods declared in interface java.lang.classfile.Instruction

    opcode, sizeInBytes
  • Method Details

    • slot

      int slot()
      Returns the local variable slot to store to.
      Returns:
      the local variable slot to store to
    • typeKind

      TypeKind typeKind()
      Returns the type of the value to be stored.
      Returns:
      the type of the value to be stored
    • of

      static StoreInstruction of(TypeKind kind, int slot)
      Returns a local variable store instruction.
      Parameters:
      kind - the type of the value to be stored
      slot - the local variable slot to store to
      Returns:
      a local variable store instruction
      Throws:
      IllegalArgumentException - if kind is void or slot is out of range
    • of

      static StoreInstruction of(Opcode op, int slot)
      Returns a local variable store instruction.
      Parameters:
      op - the opcode for the specific type of store instruction, which must be of kind Opcode.Kind.STORE
      slot - the local variable slot to store to
      Returns:
      a local variable store instruction
      Throws:
      IllegalArgumentException - if the opcode kind is not Opcode.Kind.STORE or slot is out of range