fload_0 0x22

Pushes the float in local variable 0.

Opcode
0x22 (34)
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 0.

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_0 appears 135 times in 16 of its 7,391 classes: <0.01% of all instructions, the 153rd most common of 194 opcodes in use. Some of the methods that use it: java.lang.classfile.AnnotationValue.ofFloat, java.lang.Float.toString, java.lang.invoke.Invokers$Holder.linkToTargetMethod, java.lang.invoke.LambdaForm.identity_F.

Examples

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

static boolean floatLess(float a, float b) in Compare, compiled by javac 25
8return a < b;
0fload_0 // a
1fload_1 // b

Open in the viewer

static float floats(float a, float b) in Tour, compiled by javac 25
25float x = a + b - a * b;
0fload_0 // a
1fload_1 // b
3fload_0 // a
4fload_1 // b
… 16 instructions after

Open in the viewer

Related instructions

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