fload_3 0x25

Pushes the float in local variable 3.

Opcode
0x25 (37)
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 3.

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_3 appears 143 times in 36 of its 7,391 classes: <0.01% of all instructions, the 152nd most common of 194 opcodes in use. Some of the methods that use it: java.lang.Float.floatToFloat16, java.lang.invoke.BoundMethodHandle$Species_D.copyWithExtendF, java.lang.invoke.BoundMethodHandle$Species_DL.copyWithExtendF, java.lang.invoke.BoundMethodHandle$Species_I.copyWithExtendF.

Example

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

static double convert(int i, long l, float f, double d) in Tour, compiled by javac 25
… 10 instructions before
41long il = i;
13i2l
14lstore 9// il
42float lf = l;
16lload_1 // l
17l2f
18fstore 11// lf
43int fi = (int) f;
20fload_3 // f
21f2i
22istore 12// fi
44long dl = (long) d;
24dload 4// d
26d2l
27lstore 13// dl
45float df = (float) d;
29dload 4// d
… 62 instructions after

Open in the viewer

Related instructions

fstore_3 Pops a float into local variable 3.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).