iload_0 0x1a

Pushes the int in local variable 0.

Opcode
0x1a (26)
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 0.

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_0 appears 3,941 times in 519 of its 7,391 classes: 0.20% of all instructions, the 65th most common of 194 opcodes in use. Some of the methods that use it: java.io.File$TempDirectory.shortenSubName, java.io.FilePermission.getActions, java.io.ObjectStreamClass.lambda$canonicalRecordCtr$0, java.lang.AbstractStringBuilder.isLatin1.

Examples

From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; iload_0 is highlighted.

static void big(int i) in Increments, compiled by javac 25
26i += 1000;
0wide iinc 0, 1000// i
27System.out.println(i);
6getstatic #17// System.out : PrintStream
9iload_0 // i
10invokevirtual #23// PrintStream.println(int) : void
28}

Open in the viewer

static int sparse(int code) in Tour, compiled by javac 25
103switch (code) {
0iload_0 // code
1lookupswitch { 1→36, 100→39, 10000→42, default→45 }
104case 1: return 10;
36bipush 10
105case 100: return 20;
39bipush 20
106case 10000: return 30;
42bipush 30
107default: return 0;

Open in the viewer

Related instructions

istore_0 Pops a int into local variable 0.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).