code array of
a Code attribute. Delivered as a CodeElement when traversing
the elements of a CodeModel.
API Note
While most instructions have convenience factory methods in CodeBuilder, discontinued instructions can only be supplied to code builders
explicitly with CodeBuilder::with to discourage
their use.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | DiscontinuedInstruction.
Models jump subroutine instructions discontinued from the |
| public static interface | DiscontinuedInstruction.
Models return from subroutine instructions discontinued from the |
code
array of a Code attribute since class file major version 51 (JVMS 4.9.1). Corresponding opcodes
have a kind of Opcode.Kind#DISCONTINUED_JSR .
Delivered as a CodeElement when traversing the elements of a
CodeModel.
A jump subroutine instruction is composite:
JsrInstruction(Label target)
Due to physical restrictions, jsr instructions cannot
encode labels too far away in the list of code elements. In such cases,
the ClassFile. controls how an invalid jsr
instruction model is written by a CodeBuilder.
Jump subroutine instructions push a returnAddress value to the operand stack, and astore series of instructions can then store this value to a local
variable slot.
API Note
Jump subroutine instructions are discontinued to enforce verification by
type checking (JVMS 4.10.1) using the StackMapTable attribute.
Opcode.Kind#DISCONTINUED_JSR , StackMapTableAttribute
| Modifier and Type | Method and Description |
|---|---|
| public static DiscontinuedInstruction. | Returns: a jump subroutine instructionthe opcode for the specific type of jump subroutine instruction,
which must be of kind op, Label Opcode.target label of the subroutine target)Returns a jump subroutine instruction. |
| public static DiscontinuedInstruction. | |
| public Label | Returns: the target of the jump subroutine instructionReturns the target of the jump subroutine instruction. |
| of | back to summary |
|---|---|
| public static DiscontinuedInstruction. Returns a jump subroutine instruction. API Note The explicit
| |
| of | back to summary |
|---|---|
| public static DiscontinuedInstruction. Returns a jump subroutine instruction.
| |
| target | back to summary |
|---|---|
| public Label target() Returns the target of the jump subroutine instruction.
| |
code array of a Code attribute since class file major version
51 (JVMS 4.9.1).
Corresponding opcodes have a kind of
Opcode.Kind#DISCONTINUED_RET . Delivered as a CodeElement
when traversing the elements of a CodeModel.
A return from subroutine instruction is composite:
RetInstruction(int slot)
slot must be u2.
astore series of instructions store a returnAddress value to a local variable slot,
making the slot usable by a return from subroutine instruction.
API Note
Return from subroutine instructions are discontinued to enforce
verification by type checking (JVMS 4.10.1) using the StackMapTable attribute.
Opcode.Kind#DISCONTINUED_RET , StackMapTableAttribute
| Modifier and Type | Method and Description |
|---|---|
| public static DiscontinuedInstruction. | Returns: a return from subroutine instructionthe opcode for the specific type of return from subroutine instruction,
which must be of kind op, int Opcode.the local variable slot to load return address from slot)Returns a return from subroutine instruction. |
| public static DiscontinuedInstruction. | Returns: a return from subroutine instructionthe local variable slot to load return address from slot)Returns a return from subroutine instruction. |
| public int | Returns: the local variable slot with return addressReturns the local variable slot with return address. |
| of | back to summary |
|---|---|
| public static DiscontinuedInstruction. Returns a return from subroutine instruction.
API Note The explicit
| |
| of | back to summary |
|---|---|
| public static DiscontinuedInstruction. Returns a return from subroutine instruction.
| |
| slot | back to summary |
|---|---|
| public int slot() Returns the local variable slot with return address.
It is a
| |