CONSTANT_Dynamic tag 17
A constant whose value a bootstrap method computes the first time it is loaded, and which then never changes ("condy", constant dynamic).
- Tag
17- Since
- class file 55.0 (Java 11)
- Size
- 5 bytes
- Loadable
- yes, with
ldc,ldc_w,ldc2_w - Referred to by
- ldc
- bootstrap method arguments
Layout
| Type | Field | What it holds |
|---|---|---|
u1 | tag | 17 |
u2 | bootstrap_method_attr_index | an index into the BootstrapMethods attribute |
u2 | name_and_type_index | a NameAndType with a field descriptor: the constant's type |
What it is for
A constant whose value a bootstrap method computes the first time it is loaded, and which then never changes ("condy", constant dynamic). It is to constants what invokedynamic is to calls.
javac rarely emits it for ordinary code: java.base contains none. Bytecode generators and other languages use it for lazily computed constants.
How common it is
None of the 7,391 classes in JDK 25.0.5's java.base has one.
Specification: JVMS §4.4, CONSTANT_Dynamic_info (Java SE 25).