Module java.base
Package java.lang.classfile.instructionPREVIEW

# Interface DiscontinuedInstruction.JsrInstruction

All Superinterfaces:
  `ClassFileElementPREVIEW`, `CodeElementPREVIEW`, `DiscontinuedInstructionPREVIEW`, `InstructionPREVIEW`

Enclosing interface:
  `DiscontinuedInstructionPREVIEW`

public static sealed interface DiscontinuedInstruction.JsrInstruction extends DiscontinuedInstructionPREVIEW
`JsrInstruction` is a preview API of the Java platform.
Programs can only use `JsrInstruction` when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models JSR and JSR_W instructions discontinued from the `code` array of a `Code` attribute since class file version 51.0. Corresponding opcodes will have a `kind` of `Opcode.Kind.DISCONTINUED_JSR`PREVIEW. Delivered as a `CodeElement`PREVIEW when traversing the elements of a `CodeModel`PREVIEW.

Since:
  22

- ## Nested Class Summary

  ## Nested classes/interfaces declared in interface java.lang.classfile.instruction.DiscontinuedInstructionPREVIEW

  `DiscontinuedInstruction.JsrInstructionPREVIEW, DiscontinuedInstruction.RetInstructionPREVIEW`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DiscontinuedInstruction.JsrInstructionPREVIEW`
  `of(LabelPREVIEW target)`
  Returns a JSR instruction.
  `static DiscontinuedInstruction.JsrInstructionPREVIEW`
  `of(OpcodePREVIEW op, LabelPREVIEW target)`
  Returns a JSR instruction.
  `LabelPREVIEW`
  `target()`
  Returns the target of the JSR instruction.

  ### Methods declared in interface java.lang.classfile.InstructionPREVIEW

  `opcode, sizeInBytes`

- ## Method Details

  - ### target

    LabelPREVIEW target()
    Returns the target of the JSR instruction.
    Returns:
      the target of the JSR instruction

  - ### of

    static DiscontinuedInstruction.JsrInstructionPREVIEW of(OpcodePREVIEW op, LabelPREVIEW target)
    Returns a JSR instruction.
    Parameters:
      `op` - the opcode for the specific type of JSR instruction, which must be of kind `Opcode.Kind.DISCONTINUED_JSR`PREVIEW
      `target` - target label of the subroutine
    Returns:
      a JSR instruction

  - ### of

    static DiscontinuedInstruction.JsrInstructionPREVIEW of(LabelPREVIEW target)
    Returns a JSR instruction.
    Parameters:
      `target` - target label of the subroutine
    Returns:
      a JSR instruction