CONSTANT_Double tag 6

A double constant, loaded with ldc2_w.

Tag
6
Since
class file 45.0 (Java 1.0)
Size
9 bytes
Loadable
yes, with ldc2_w
Referred to by
  • ldc2_w
  • ConstantValue of double fields

Layout

TypeFieldWhat it holds
u1tag6
u4high_bytesupper 32 bits of the IEEE 754 double
u4low_byteslower 32 bits

What it is for

A double constant, loaded with ldc2_w. 0.0 and 1.0 have dconst instructions.

Like Long, a Double takes two constant pool slots, and the index after it is unusable.

How common it is

JDK 25.0.5's java.base has 1,435 Double constants in 55 of its 7,391 classes: 0.14% of all 1,059,609 constants.

A real one, byte by byte

Constant #80 of Numbers.class, compiled by javac 25:

OffsetBytesFieldValue
6859 bytes#80 Double3.14159
68506tag6 (Double)
68640 09 21 f9high_bytes1074340345
690f0 1b 86 6elow_bytes4028335726

Open in the viewer

Specification: JVMS §4.4, CONSTANT_Double_info (Java SE 25).