faload 0x30
Pops an array and an index; pushes the float element.
- Opcode
0x30(48)- Family
- Arrays
- Operands
- none
- Length
- 1 byte
- Operand stack
…, arrayref, index → …, value (float)- Can throw
NullPointerException,ArrayIndexOutOfBoundsException
What it does
Pops an array (float[]) and an index; pushes the element at that index.
How often javac uses it
In JDK 25.0.5's java.base module, faload appears 154 times in 13 of its 7,391 classes: <0.01% of all instructions, the 151st most common of 194 opcodes in use. Some of the methods that use it: java.io.ObjectOutputStream$BlockDataOutputStream.writeFloats, java.lang.classfile.AnnotationValue.of, java.lang.invoke.MethodHandleImpl$ArrayAccessor.getElementF, java.lang.invoke.VarHandleFloats$Array.get.
Example
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; faload is highlighted.
static int arrays(int n) in Tour, compiled by javac 25Related instructions
fastore Pops an array, an index and a float 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, faload (Java SE 25).