Below the Fold, Adventures in Constancy
summary
Adds a constant_descriptor API and a Constable interface so the static compiler treats rich constant expressions (including method‑handle and invokedynamic descriptions) as compile‑time constants, marks small factory methods as constant factories, evaluates them at compile time, emits real constant pool entries (LDCs/invokespecial bootstrap entries), then dead‑code‑eliminates the scaffolding. Result: previously 50+ bytecode instructions often collapse to a single LDC, capturing lambdas become non‑capturing, builders fold into one constant, and the approach successfully produces much smaller startup code.
AI-written summary · about
chapters (9)
- 0:00Start
- 4:25Exposing indylcondy in Java
- 7:07Descriptions are nominal
- 8:35A constants API
- 15:45Improved Constant Folding
- 19:35Improved Constant Propagation
- 24:44Bonus: Lambda Decapturing
- 30:15Library-directed constantization
- 35:58ConstantDesc, Constable, constant factories
related talks
46mConstants in Amber
01h 04mconstexpr: Introduction
50mC++ Costless Abstractions: the compiler view
39mBytecode Pattern Matching
12mCompile-Time Counter Using Template & Constexpr Magic
01h 01mExpressive Compile Time Parsers
37mRecords, Not Just Constant Classes, A Deep Dive
01h 01mThe Static Dynamic JVM – A Many Layered Dive
