Interface InvokeInstruction

All Superinterfaces:
ClassFileElementPREVIEW, CodeElementPREVIEW, InstructionPREVIEW

public sealed interface InvokeInstruction extends InstructionPREVIEW
InvokeInstruction is a preview API of the Java platform.
Programs can only use InvokeInstruction 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 method invocation instruction in the code array of a Code attribute, other than invokedynamic. Corresponding opcodes will have a kind of Opcode.Kind.INVOKEPREVIEW. Delivered as a CodeElementPREVIEW when traversing the elements of a CodeModelPREVIEW.
Since:
22
  • Method Details

    • method

      Returns the MethodRefEntryPREVIEW or InterfaceMethodRefEntryPREVIEW constant described by this instruction.
      Returns:
      the MethodRefEntryPREVIEW or InterfaceMethodRefEntryPREVIEW constant described by this instruction
    • isInterface

      boolean isInterface()
      Returns whether the class holding the method is an interface.
      Returns:
      whether the class holding the method is an interface
    • count

      int count()
      Returns the count value of an invokeinterface instruction, as defined in 6.5 or 0 for invokespecial, invokestatic and invokevirtual instructions.
      Returns:
      the count value of an invokeinterface instruction, as defined in 6.5 or 0 for invokespecial, invokestatic and invokevirtual instructions
    • owner

      default ClassEntryPREVIEW owner()
      Returns the class holding the method.
      Returns:
      the class holding the method
    • name

      default Utf8EntryPREVIEW name()
      Returns the name of the method.
      Returns:
      the name of the method
    • type

      default Utf8EntryPREVIEW type()
      Returns the method descriptor of the method.
      Returns:
      the method descriptor of the method
    • typeSymbol

      default MethodTypeDesc typeSymbol()
      Returns a symbolic descriptor for the method type.
      Returns:
      a symbolic descriptor for the method type
    • of

      Returns an invocation instruction.
      Parameters:
      op - the opcode for the specific type of invocation instruction, which must be of kind Opcode.Kind.INVOKEPREVIEW
      method - a constant pool entry describing the method
      Returns:
      an invocation instruction
    • of

      static InvokeInstructionPREVIEW of(OpcodePREVIEW op, ClassEntryPREVIEW owner, Utf8EntryPREVIEW name, Utf8EntryPREVIEW type, boolean isInterface)
      Returns an invocation instruction.
      Parameters:
      op - the opcode for the specific type of invocation instruction, which must be of kind Opcode.Kind.INVOKEPREVIEW
      owner - the class holding the method
      name - the name of the method
      type - the method descriptor
      isInterface - whether the class holding the method is an interface
      Returns:
      an invocation instruction
    • of

      static InvokeInstructionPREVIEW of(OpcodePREVIEW op, ClassEntryPREVIEW owner, NameAndTypeEntryPREVIEW nameAndType, boolean isInterface)
      Returns an invocation instruction.
      Parameters:
      op - the opcode for the specific type of invocation instruction, which must be of kind Opcode.Kind.INVOKEPREVIEW
      owner - the class holding the method
      nameAndType - the name and type of the method
      isInterface - whether the class holding the method is an interface
      Returns:
      an invocation instruction