CONSTANT_Dynamic
summary
JDK 11 adds Constant_Dynamic (Condy), a bootstrap-linked constant that puts JSR-292 style linkage into the constant pool so LDC can return runtime-computed constants directly instead of wrapping them in CallSite/methodhandle indirections. Condy stores primitive class mirrors, stores varhandles and null and enum constants, and reduces repeated bootstrap overhead and identity duplication (non-capturing lambdas/method refs can be emitted as LDC so the bootstrap runs once). Guidance: use java.lang.invoke.ConstantBootstraps, make bootstraps idempotent, beware resolution races and classloader lifetime leaks. Future work: bootstrap call info lazy resolution and extended invocation modes.
AI-written summary · about
chapters (17)
- 0:00Start
- 2:43Invokedynamic refresher: bootstrap method
- 3:10Invokedynamic refresher: linked
- 15:23Pitfalls
- 20:05ORACLE Safe Harbor Statement
- 23:39ConstantBootstraps :: invoke
- 24:36Drop metadata arguments
- 26:19A more generic solution
- 28:05Lazy resolution of bootstrap method arguments
- 30:07Resolve arguments on demand
- 31:20Access an argument in nominal form
- 32:23BSM invocation summary
- 32:42Java 12?
- 33:40invoke dynamic
- 35:44in the main repo
- 36:09in the amber repo
- 36:51General data in the constant pool








