fastore 0x51
Pops an array, an index and a float value; stores the value in the array.
- Opcode
0x51(81)- Family
- Arrays
- Operands
- none
- Length
- 1 byte
- Operand stack
…, arrayref, index, value (float) → …- Can throw
NullPointerException,ArrayIndexOutOfBoundsException
What it does
Pops an array (float[]), an index and a value; stores the value at that index.
How often javac uses it
In JDK 25.0.5's java.base module, fastore appears 102 times in 10 of its 7,391 classes: <0.01% of all instructions, the 156th most common of 194 opcodes in use. Some of the methods that use it: java.io.ObjectInputStream$BlockDataInputStream.readFloats, java.lang.invoke.MethodHandleImpl$ArrayAccessor.setElementF, java.lang.invoke.VarHandleFloats$Array.set, java.math.BigDecimal.<clinit>.
Example
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; fastore is highlighted.
static int arrays(int n) in Tour, compiled by javac 25Related instructions
faload Pops an array and an index; pushes the float element.arraylength Pops an array; pushes its length.newarray Pops a length; pushes a new array of a primitive type.
Specification: JVMS §6.5, fastore (Java SE 25).