Updated specifications

Dan Heidinga dan.heidinga at oracle.com
Wed Jun 5 16:21:18 UTC 2024


Thanks for making the update from Preload to LoadableDescriptors.  It cleans up the spec a lot.

I have concerns about the changes to 5.4 related to loading classes.  As discussed at the offsite meeting, from an implementation perspective, we don’t want to introduce new rules that allow loading of arbitrary classes at any point during linking.  There are already rules in place about further execution being driven by the invocation of the main method (JVMS 5.2) and the linking activities driven by its execution.  Introducing new rules that legitimize other loading strategies are outside the remit of Valhalla and are unnecessary for our purposes.

The original 5.4 states “Linking also involves resolution of symbolic references in the class or interface, though not necessarily at the same time as the class or interface is verified and prepared.” which already allows for loading of necessary classes.  The new sentence “All of these linking activities may involve the loading of other classes and interfaces mentioned in the constant pool of the current class or interface.” unnecessary widens what and when loading can occur and opens doors I don’t think we need or want opened.

I think this change should also be reverted: “, (and, because of recursion, loading) including the loading of other classes,” as it broadens the loading behaviour beyond what the original struck thru clause meant.

The new clause:
>If a class being linked has a LoadableDescriptors attribute (4.7.32<https://cr.openjdk.org/~dlsmith/jep401/jep401-20240603/specs/value-objects-jvms.html#jvms-4.7.32>), then during any phase of linking, a Java Virtual Machine implementation may optionally load any of the classes or interfaces mentioned by the entries of the descriptors array of the LoadableDescriptors attribute. Any exception that is thrown as a result of failure to load the class or interface must be ignored and discarded.
sufficiently covers the behaviour we want to add in Valhalla.

Thanks,
--Dan

From: valhalla-spec-experts <valhalla-spec-experts-retn at openjdk.org> on behalf of Dan Smith <daniel.smith at oracle.com>
Date: Monday, June 3, 2024 at 3:00 PM
To: valhalla-spec-experts <valhalla-spec-experts at openjdk.java.net>
Subject: Updated specifications
I've posted updated specifications for JEP 401 here:

https://cr.openjdk.org/~dlsmith/jep401/jep401-20240603/specs/value-objects-jls.html
https://cr.openjdk.org/~dlsmith/jep401/jep401-20240603/specs/value-objects-jvms.html

These are intended to address all the needs of JEP 401, and I don't expect many further revisions—but as always, happy to hear any feedback.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20240605/d1d26ad7/attachment-0001.htm>


More information about the valhalla-spec-observers mailing list