fload_2 0x24

Pushes the float in local variable 2.

Opcode
0x24 (36)
Family
Loads
Operands
none
Length
1 byte
Operand stack
… → …, value (float)
Can throw
nothing at run time (beyond linking errors)
Spec name
fload_<n>

What it does

Pushes the float in local variable 2.

Slots 0 to 3 each have a one-byte instruction; the general fload takes a one-byte slot number, and wide extends that to two bytes.

How often javac uses it

In JDK 25.0.5's java.base module, fload_2 appears 157 times in 55 of its 7,391 classes: <0.01% of all instructions, the 149th most common of 194 opcodes in use. Some of the methods that use it: java.io.ObjectInputStream$FieldValues.get, java.io.ObjectOutputStream$HandleTable.<init>, java.io.ObjectOutputStream$PutFieldImpl.put, java.io.ObjectOutputStream$ReplaceTable.<init>.

Example

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

static float floats(float a, float b) in Tour, compiled by javac 25
… 3 instructions before
25float x = a + b - a * b;
3fload_0 // a
4fload_1 // b
7fstore_2 // x
26x = x / b % 7f;
8fload_2 // x
9fload_1 // b
10fdiv
11ldc #13// 7
13frem
14fstore_2 // x
27return -x + 0f + 1f + 2f;
15fload_2 // x
… 8 instructions after

Open in the viewer

Related instructions

fstore_2 Pops a float into local variable 2.fload Pushes the float 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, fload_<n> (Java SE 25).