iload_1 0x1b
Pushes the int in local variable 1.
- Opcode
0x1b(27)- Family
- Loads
- Operands
- none
- Length
- 1 byte
- Operand stack
… → …, value (int)- Can throw
- nothing at run time (beyond linking errors)
- Spec name
iload_<n>
What it does
Pushes the int in local variable 1.
Slots 0 to 3 each have a one-byte instruction; the general iload takes a one-byte slot number, and wide extends that to two bytes.
int locals also hold booleans, bytes, chars and shorts: the JVM has no smaller local variable types.
How often javac uses it
In JDK 25.0.5's java.base module, iload_1 appears 15,276 times in 1,875 of its 7,391 classes: 0.78% of all instructions, the 36th most common of 194 opcodes in use. Some of the methods that use it: java.io.BufferedInputStream.getBufIfOpen, java.io.BufferedOutputStream.growIfNeeded, java.io.BufferedReader.fill, java.io.BufferedWriter.growIfNeeded.
Examples
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; iload_1 is highlighted.
int assignField(int v) in Tour, compiled by javac 25static String greet(String name, int count) in Concat, compiled by javac 25return "Hello, " + name + "! You have " + count + " new messages.";Related instructions
istore_1 Pops a int into local variable 1.iload Pushes the int in local variable (operand).wide Makes the next instruction take a two-byte local index (and a two-byte iinc constant).
Specification: JVMS §6.5, iload_<n> (Java SE 25).