Interface StoreInstruction

All Superinterfaces:
ClassFileElementPREVIEW, CodeElementPREVIEW, InstructionPREVIEW

public sealed interface StoreInstruction extends InstructionPREVIEW
StoreInstruction is a preview API of the Java platform.
Programs can only use StoreInstruction when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models a local variable store instruction in the code array of a Code attribute. Corresponding opcodes will have a kind of Opcode.Kind.STOREPREVIEW. Delivered as a CodeElementPREVIEW when traversing the elements of a CodeModelPREVIEW.
Since:
22
  • Method Details

    • slot

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

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

      static StoreInstructionPREVIEW of(TypeKindPREVIEW 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
    • of

      static StoreInstructionPREVIEW of(OpcodePREVIEW 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.STOREPREVIEW
      slot - the local variable slot to store to
      Returns:
      a local variable store instruction
      Throws:
      IllegalArgumentException - if the opcode kind is not Opcode.Kind.STOREPREVIEW.