Preload attribute

Dan Heidinga heidinga at redhat.com
Thu Jun 1 17:53:42 UTC 2023


A couple of questions about the spec for the Preload attribute[0].  The
current spec says it indicates "certain classes contain information that
may be of interest during linkage."

The Preload attribute removes one need for Q modifiers while allowing
calling convention optimizations and layout decisions to be made early.

The current spec is quite vague on what classes should be included in the
attribute and on when / what the VM will do with those classes (or even if
it does anything).  I think it's time to tighten up the spec for Preload
attribute and specify:
* what the VM will do with classes listed in the attribute
* when those classes will be loaded (ie: somewhere in JVMS 5.3)
* how invalid cases are handled, including circularities (Class A's Preload
mentions B <: A)
* what types of classes can be listed (any? only values?)

And there's probably other issues to clarify.  Otherwise, the current spec
isn't clear enough for users to know when to add a class, how it will be
treated, and any potential edge cases to avoid.

It probably makes sense to start from the current Hotspot handling of the
attribute and fine tune that into the spec?

--Dan

[0]
https://cr.openjdk.org/~dlsmith/jep401/jep401-20230404/specs/value-objects-jvms.html#jvms-4.7.31
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20230601/afabf5f5/attachment-0001.htm>


More information about the valhalla-spec-observers mailing list