Interface ReturnInstruction
- All Superinterfaces:
ClassFileElementPREVIEW
,CodeElementPREVIEW
,InstructionPREVIEW
ReturnInstruction
is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models a return-from-method instruction in the
code
array of a
Code
attribute. Corresponding opcodes will have a kind
of
Opcode.Kind.RETURN
PREVIEW. Delivered as a CodeElement
PREVIEW when
traversing the elements of a CodeModel
PREVIEW.- Since:
- 22
-
Method Summary
Methods declared in interface java.lang.classfile.InstructionPREVIEW
opcode, sizeInBytes
-
Method Details
-
typeKind
-
of
Returns a return instruction.- Parameters:
typeKind
- the type of the return instruction- Returns:
- a return instruction
-
of
Returns a return instruction.- Parameters:
op
- the opcode for the specific type of return instruction, which must be of kindOpcode.Kind.RETURN
PREVIEW- Returns:
- a return instruction
- Throws:
IllegalArgumentException
- if the opcode kind is notOpcode.Kind.RETURN
PREVIEW.
-
ReturnInstruction
when preview features are enabled.