lstore_2 0x41
Pops a long into local variable 2.
- Opcode
0x41(65)- Family
- Stores
- Operands
- none
- Length
- 1 byte
- Operand stack
…, value (long) → …- Can throw
- nothing at run time (beyond linking errors)
- Spec name
lstore_<n>
What it does
Pops a long into local variable 2. It is a long or double, so it takes two slots: local variables n and n+1, and two stack slots.
Slots 0 to 3 each have a one-byte instruction; the general lstore takes a one-byte slot number, and wide extends that to two bytes.
How often javac uses it
In JDK 25.0.5's java.base module, lstore_2 appears 576 times in 196 of its 7,391 classes: 0.03% of all instructions, the 119th most common of 194 opcodes in use. Some of the methods that use it: java.io.FileCleanable.register, java.io.FileInputStream.traceRead0, java.io.InputStream.transferTo, java.io.RandomAccessFile.traceRead0.
Related instructions
lload_2 Pushes the long in local variable 2.lstore Pops a long into local variable (operand).wide Makes the next instruction take a two-byte local index (and a two-byte iinc constant).
Specification: JVMS §6.5, lstore_<n> (Java SE 25).