dload_3 0x29

Pushes the double in local variable 3.

Opcode
0x29 (41)
Family
Loads
Operands
none
Length
1 byte
Operand stack
… → …, value (double)
Can throw
nothing at run time (beyond linking errors)
Spec name
dload_<n>

What it does

Pushes the double in local variable 3. It is a long or double, so it takes two slots: local variables n and n+1, and two stack slots.

Slots 0 to 3 each have a one-byte instruction; the general dload 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, dload_3 appears 201 times in 49 of its 7,391 classes: 0.01% of all instructions, the 143rd most common of 194 opcodes in use. Some of the methods that use it: java.lang.FdLibm$Cos.compute, java.lang.FdLibm$RemPio2.__ieee754_rem_pio2, java.lang.FdLibm$Sin.compute, java.lang.FdLibm$Tan.compute.

Example

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

Rect(double w, double h) in Shapes.Rect, compiled by javac 25
5record Rect(double w, double h) implements Shape {}
0aload_0 // this
1invokespecial #1// new Record()
4aload_0 // this
5dload_1 // w
6putfield #7// Shapes$Rect.w : double
9aload_0 // this
10dload_3 // h
11putfield #13// Shapes$Rect.h : double

Open in the viewer

Related instructions

dstore_3 Pops a double into local variable 3.dload Pushes the double 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, dload_<n> (Java SE 25).