Interface LoadInstruction
- All Superinterfaces:
- ClassFileElement,- CodeElement,- Instruction
Models a local variable load instruction in the 
 where 
code array of a
 Code attribute.  Corresponding opcodes have a kind of Opcode.Kind.LOAD.  Delivered as a CodeElement when traversing the elements of a CodeModel.
 A local variable load instruction is composite:
LoadInstruction(
    TypeKind typeKind,
    int slot
)
TypeKind is computational, and slot is within [0, 65535].- Since:
- 24
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionstatic LoadInstructionReturns a local variable load instruction.static LoadInstructionReturns a local variable load instruction.intslot()Returns the local variable slot to load from.typeKind()Returns the computational type of the value to be loaded.Methods declared in interface java.lang.classfile.Instructionopcode, sizeInBytes
- 
Method Details- 
slotint slot()Returns the local variable slot to load from. The value is within[0, 65535].- Returns:
- the local variable slot to load from
 
- 
typeKindTypeKind typeKind()Returns the computational type of the value to be loaded.- Returns:
- the computational type of the value to be loaded
 
- 
ofReturns a local variable load instruction.kindis converted to its computational type.slotmust be within[0, 65535].- Parameters:
- kind- the type of the value to be loaded
- slot- the local variable slot to load from
- Returns:
- a local variable load instruction
- Throws:
- IllegalArgumentException- if- kindis- voidor- slotis out of range
 
- 
ofReturns a local variable load instruction.The range of slotis restricted by theopand its size:- If ophas size 1,slotmust be exactly the slot value implied by the opcode.
- If ophas size 2,slotmust be within[0, 255].
- If ophas size 4,slotmust be within[0, 65535].
 - API Note:
- The explicit opargument allows creatingwideor regular load instructions when theslotcan be encoded with more optimized load instructions.
- Parameters:
- op- the opcode for the specific type of load instruction, which must be of kind- Opcode.Kind.LOAD
- slot- the local variable slot to load from
- Returns:
- a local variable load instruction
- Throws:
- IllegalArgumentException- if the opcode kind is not- Opcode.Kind.LOADor- slotis out of range
 
- If 
 
-