ClassFileElement, CodeElement, Instructionpublic sealed interface StoreInstruction extends Instruction
code array of a Code attribute. Corresponding opcodes have a kind of Opcode.Kind.STORE. Delivered as a CodeElement when traversing the elements of a CodeModel. A local variable store instruction is composite:
StoreInstruction(
TypeKind typeKind,
int slot
)
TypeKind is computational, and slot is within [0, 65535]. astore series of instructions, or reference type store instructions, can also operate on the returnAddress type from discontinued jump subroutine instructions.
| Modifier and Type | Method | Description |
|---|---|---|
static StoreInstruction |
of |
Returns a local variable store instruction. |
static StoreInstruction |
of |
Returns a local variable store instruction. |
int |
slot() |
Returns the local variable slot to store to. |
TypeKind |
typeKind() |
Returns the computational type of the value to be stored. |
opcode, sizeInBytes
int slot()
[0, 65535].TypeKind typeKind()
reference type store instructions also operate on the returnAddress type, which does not apply to reference type load instructions.static StoreInstruction of(TypeKind kind, int slot)
kind is converted to its computational type. slot must be within [0, 65535].kind - the type of the value to be storedslot - the local variable slot to store toIllegalArgumentException - if kind is void or slot is out of rangestatic StoreInstruction of(Opcode op, int slot)
The range of slot is restricted by the op and its size:
op has size 1, slot must be exactly the slot value implied by the opcode. op has size 2, slot must be within [0, 255]. op has size 4, slot must be within [0, 65535]. op argument allows creating wide or regular store instructions when the slot can be encoded with more optimized store instructions.op - the opcode for the specific type of store instruction, which must be of kind Opcode.Kind.STORE
slot - the local variable slot to store toIllegalArgumentException - if the opcode kind is not Opcode.Kind.STORE or slot is out of range
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/classfile/instruction/StoreInstruction.html