iaload 0x2e
Pops an array and an index; pushes the int element.
- Opcode
0x2e(46)- Family
- Arrays
- Operands
- none
- Length
- 1 byte
- Operand stack
…, arrayref, index → …, value (int)- Can throw
NullPointerException,ArrayIndexOutOfBoundsException
What it does
Pops an array (int[]) and an index; pushes the element at that index.
How often javac uses it
In JDK 25.0.5's java.base module, iaload appears 2,558 times in 291 of its 7,391 classes: 0.13% of all instructions, the 79th most common of 194 opcodes in use. Some of the methods that use it: java.io.ObjectInputStream$FieldValues.get, java.io.ObjectInputStream$HandleTable$HandleList.get, java.io.ObjectOutputStream$BlockDataOutputStream.writeInts, java.io.ObjectOutputStream$HandleTable.lookup.
Examples
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; iaload is highlighted.
static void array(int[] a, int i) in Increments, compiled by javac 25static boolean weekend(DayOfWeek day) in EnumSwitch, compiled by javac 25Related instructions
iastore Pops an array, an index and a int value; stores the value in the array.arraylength Pops an array; pushes its length.newarray Pops a length; pushes a new array of a primitive type.
Specification: JVMS §6.5, iaload (Java SE 25).