Interface LoadInstruction
- All Superinterfaces:
ClassFileElementPREVIEW,CodeElementPREVIEW,InstructionPREVIEW
LoadInstruction 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 local variable load instruction in the
code array of a
Code attribute. Corresponding opcodes will have a kind of
Opcode.Kind.LOADPREVIEW. Delivered as a CodeElementPREVIEW when
traversing the elements of a CodeModelPREVIEW.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionstatic LoadInstructionPREVIEWReturns a local variable load instruction.static LoadInstructionPREVIEWReturns a local variable load instruction.intslot()Returns the local variable slot to load from.typeKind()Returns the type of the value to be loaded.Methods declared in interface java.lang.classfile.InstructionPREVIEW
opcode, sizeInBytes
-
Method Details
-
slot
int slot()Returns the local variable slot to load from.- Returns:
- the local variable slot to load from
-
typeKind
-
of
Returns a local variable load instruction.- Parameters:
kind- the type of the value to be loadedslot- the local variable slot to load from- Returns:
- a local variable load instruction
- Throws:
IllegalArgumentException- ifkindisvoidPREVIEW orslotis out of range
-
of
Returns a local variable load instruction.- Parameters:
op- the opcode for the specific type of load instruction, which must be of kindOpcode.Kind.LOADPREVIEWslot- the local variable slot to load from- Returns:
- a local variable load instruction
- Throws:
IllegalArgumentException- if the opcode kind is notOpcode.Kind.LOADPREVIEW orslotis out of range
-
LoadInstructionwhen preview features are enabled.