frozen arrays

John Rose john.r.rose at oracle.com
Thu Feb 4 00:23:27 UTC 2021


We use @Stable arrays internally to instruct the JIT
to constant-fold through array elements.

A long-term goal is to replace those (when lazy
evaluation is not required) with first-class frozen
arrays.  Doing this right, as a generally useful
feature (not an internal hack) will require a
carefully balanced user model, changes to the
language and VM specs, and some JIT and
runtime work.

Towards that end, I have filed a pair of JEPs
which document a way forward towards
frozen arrays, starting with an internal
alternative to @Stable.

Please see:

the name is Arrays, Frozen Arrays
https://bugs.openjdk.java.net/browse/JDK-8261007

and Internal Frozen Arrays (the prequel)
https://bugs.openjdk.java.net/browse/JDK-8261099

— John

P.S. Hat tip to early commenters on Slack: Brian, Stuart,
Jon, and Alan.  Stuart convinced me to split it into two.


More information about the hotspot-runtime-dev mailing list