Cache Me If You Can
summary
OpenJDK's Project Valhalla introduces value classes (JEP 401) and a narrower form, null-restricted value classes, to encode data objects without identity and pack fields densely for better cache locality. Experiments (OpenJ9 EA and builds) show flattening can be limited by atomicity and null representation — adding a null bit can force alignment to 64 bits so a 32-bit int becomes 64 bits — so OpenJ9 sometimes avoids flattening. Arrays can have flattened components, escape analysis and generics work remain future targets.
AI-written summary · about
