lload 0x16
Pushes the long in local variable (operand).
- Opcode
0x16(22)- Family
- Loads
- Operands
- 1 byte: local variable index
- Length
- 2 bytes
- Operand stack
… → …, value (long)- Can throw
- nothing at run time (beyond linking errors)
What it does
Pushes the long in the local variable named by its operand. 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 have one-byte forms (lload_0 to lload_3); javac uses this form for slots 4 to 255, and wide for slots above 255.
How often javac uses it
In JDK 25.0.5's java.base module, lload appears 14,779 times in 536 of its 7,391 classes: 0.76% of all instructions, the 37th most common of 194 opcodes in use. Some of the methods that use it: java.io.BufferedInputStream.skip, java.io.BufferedReader.skip, java.io.CharArrayReader.skip, java.io.DataOutputStream.tooLongMsg.
Examples
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; lload is highlighted.
static int locals(int a, int b, int c, int d, long e, double f) in Tour, compiled by javac 25static long mix(long a, int b, short c, byte d, double e, float f, char g, boolean h) in Numbers, compiled by javac 25Related instructions
lstore Pops a long into local variable (operand).lload_0 Pushes the long in local variable 0.wide Makes the next instruction take a two-byte local index (and a two-byte iinc constant).
Specification: JVMS §6.5, lload (Java SE 25).