Top Description Methods
java.lang.classfile.instruction

public sealed Interface LoadInstruction

extends Instruction
Known Direct Implementers
jdk.internal.classfile.impl.AbstractInstruction.BoundLoadInstruction, jdk.internal.classfile.impl.AbstractInstruction.UnboundLoadInstruction
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.lang.classfile.CodeElement, .CodeModel, .Instruction, .Opcode, .TypeKind, jdk.internal.classfile.impl.AbstractInstruction, .BytecodeHelpers, .Util, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use LoadInstruction 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 local variable load instruction in the code array of a Code attribute. Corresponding opcodes will have a kind of Opcode.Kind#LOAD. Delivered as a CodeElement when traversing the elements of a CodeModel.
Since
22

Method Summary

Modifier and TypeMethod and Description
public static LoadInstruction

Returns:

a local variable load instruction
of
(TypeKind
the type of the value to be loaded
kind
,
int
the local variable slot to load from
slot
)

Returns a local variable load instruction.

public static LoadInstruction

Returns:

a local variable load instruction
of
(Opcode
the opcode for the specific type of load instruction, which must be of kind Opcode.Kind#LOAD
op
,
int
the local variable slot to load from
slot
)

Returns a local variable load instruction.

public int

Returns:

the local variable slot to load from
slot
()

Returns the local variable slot to load from.

public TypeKind

Returns:

the type of the value to be loaded
typeKind
()

Returns the type of the value to be loaded.

Inherited from java.lang.classfile.Instruction:
opcodesizeInBytes

Method Detail

ofback to summary
public static LoadInstruction of(TypeKind kind, int slot)

Returns a local variable load instruction.

Parameters
kind:TypeKind

the type of the value to be loaded

slot:int

the local variable slot to load from

Returns:LoadInstruction

a local variable load instruction

ofback to summary
public static LoadInstruction of(Opcode op, int slot)

Returns a local variable load instruction.

Parameters
op:Opcode

the opcode for the specific type of load instruction, which must be of kind Opcode.Kind#LOAD

slot:int

the local variable slot to load from

Returns:LoadInstruction

a local variable load instruction

Exceptions
IllegalArgumentException:
if the opcode kind is not Opcode.Kind#LOAD.
slotback to summary
public int slot()

Returns the local variable slot to load from.

Returns:int

the local variable slot to load from

typeKindback to summary
public TypeKind typeKind()

Returns the type of the value to be loaded.

Returns:TypeKind

the type of the value to be loaded