fload 0x17

Pushes the float in local variable (operand).

Opcode
0x17 (23)
Family
Loads
Operands
  • 1 byte: local variable index
Length
2 bytes
Operand stack
… → …, value (float)
Can throw
nothing at run time (beyond linking errors)

What it does

Pushes the float in the local variable named by its operand.

Slots 0 to 3 have one-byte forms (fload_0 to fload_3); javac uses this form for slots 4 to 255, and wide for slots above 255.

How often javac uses it

In JDK 25.0.5's java.base module, fload appears 287 times in 23 of its 7,391 classes: 0.01% of all instructions, the 137th most common of 194 opcodes in use. Some of the methods that use it: java.lang.classfile.AnnotationValue.of, java.lang.Float.float16ToFloat, java.lang.invoke.DelegatingMethodHandle$Holder.reinvoke_L, java.lang.invoke.DirectMethodHandle$Holder.invokeSpecial.

Examples

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

static double convert(int i, long l, float f, double d) in Tour, compiled by javac 25
… 49 instructions before
53return b + c + s + il + lf + fi + dl + df + li + fd + fl + iff + id + ld + di;
70iadd
71i2l
72lload 9// il
74ladd
75l2f
76fload 11// lf
78fadd
79iload 12// fi
81i2f
82fadd
83lload 13// dl
85l2f
… 23 instructions after

Open in the viewer

static long mix(long a, int b, short c, byte d, double e, float f, char g, boolean h) in Numbers, compiled by javac 25
… 8 instructions before
30long r = a * b + c - d;
9i2l
10lsub
11lstore 10// r
31r ^= (long) (e * f);
13lload 10// r
15dload 5// e
17fload 7// f
19f2d
20dmul
21d2l
22lxor
23lstore 10// r
32r += g;
25lload 10// r
… 49 instructions after

Open in the viewer

Related instructions

fstore Pops a float into local variable (operand).fload_0 Pushes the float in local variable 0.wide Makes the next instruction take a two-byte local index (and a two-byte iinc constant).

Specification: JVMS §6.5, fload (Java SE 25).