dconst_0 0x0e
Pushes the double constant 0.
- Opcode
0x0e(14)- Family
- Constants
- Operands
- none
- Length
- 1 byte
- Operand stack
… → …, 0 (double)- Can throw
- nothing at run time (beyond linking errors)
- Spec name
dconst_<d>
What it does
Pushes the double 0.0. Only 0 and 1 have one-byte instructions; any other double constant needs ldc2_w of a Double constant.
How often javac uses it
In JDK 25.0.5's java.base module, dconst_0 appears 163 times in 50 of its 7,391 classes: <0.01% of all instructions, the 146th most common of 194 opcodes in use. Some of the methods that use it: java.io.ObjectStreamReflection.defaultReadObject, java.io.StreamTokenizer.nextToken, java.lang.Double.toHexString, java.lang.FdLibm$Acos.compute.
Example
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; dconst_0 is highlighted.
static double doubles(double a, double b) in Tour, compiled by javac 25… 11 instructions before
Related instructions
ldc2_w Pushes a long or double constant from the constant pool.
Specification: JVMS §6.5, dconst_<d> (Java SE 25).