Skip to content

8382584: [lworld] Mandatory pre-loading still present in systemDictionary.cpp#2409

Open
caspernorrbin wants to merge 2 commits into
openjdk:lworldfrom
caspernorrbin:systemdict-nullrestricted-loading
Open

8382584: [lworld] Mandatory pre-loading still present in systemDictionary.cpp#2409
caspernorrbin wants to merge 2 commits into
openjdk:lworldfrom
caspernorrbin:systemdict-nullrestricted-loading

Conversation

@caspernorrbin
Copy link
Copy Markdown
Member

@caspernorrbin caspernorrbin commented May 7, 2026

Hi everyone,

This change removes the remaining mandatory preloading path for null-restricted instance fields when loading classes from CDS. JDK-8380053 already changed normal class loading so null-restricted field types are no longer loaded just because the field is null-restriced. Instead, the preloading is speculative and driven by the LoadableDescriptor attribute. The CDS path still had the older special case in SystemDictionary::preload_from_null_free_field, which could force loading of null-restricted field types.

This fix removes that CDS-only preload helper and routes non-static field signatures through the existing LoadableDescriptor path instead. This makes loading follow the same model as in ClassFileParser::fetch_field_classes() with speculative loading.

Testing:

  • Tier 1-3


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8382584: [lworld] Mandatory pre-loading still present in systemDictionary.cpp (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2409/head:pull/2409
$ git checkout pull/2409

Update a local copy of the PR:
$ git checkout pull/2409
$ git pull https://git.openjdk.org/valhalla.git pull/2409/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2409

View PR using the GUI difftool:
$ git pr show -t 2409

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2409.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 7, 2026

👋 Welcome back cnorrbin! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 7, 2026

@caspernorrbin This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8382584: [lworld] Mandatory pre-loading still present in systemDictionary.cpp

Reviewed-by: coleenp

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 216 new commits pushed to the lworld branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@coleenp) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk Bot changed the title 8382584 8382584: [lworld] Mandatory pre-loading still present in systemDictionary.cpp May 7, 2026
@openjdk openjdk Bot added the rfr Pull request is ready for review label May 7, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 7, 2026

Webrevs

// A false return means that the class didn't load for other reasons than an exception.
bool check = preload_from_null_free_field(ik, class_loader, sig, field_index, CHECK_NULL);
if (!check) {
ik->set_shared_loading_failed();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we safely drop this failure marking?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used for regular shared class loading so I don't think we can drop this shared_loading_failed marker.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't realise that one was needed. I've re-added it, along with an edit to try_preload_from_loadable_descriptors so we can see if we failed or not. It now also has a new parameter that decides if failing means we call shared_loading_failed .

Copy link
Copy Markdown
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

// A false return means that the class didn't load for other reasons than an exception.
bool check = preload_from_null_free_field(ik, class_loader, sig, field_index, CHECK_NULL);
if (!check) {
ik->set_shared_loading_failed();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used for regular shared class loading so I don't think we can drop this shared_loading_failed marker.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants