Skip to content

Conversation

david-beaumont
Copy link
Contributor

@david-beaumont david-beaumont commented Sep 22, 2025

C++ changes for supporting preview mode when preview mode resources (with new location flags) are available.

At the moment, this code will operate on non-preview jimage files (1.0) and act as if no preview resources are available by virtue of the default value for missing attributes being zero (which matches location flags for "normal" entries).


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8366093: [lworld] Add preview mode to C++ classloader (Sub-task - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1609

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 22, 2025

👋 Welcome back david-beaumont! 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

openjdk bot commented Sep 22, 2025

@david-beaumont 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:

8366093: [lworld] Add preview mode to C++ classloader

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 245 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.

➡️ 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 added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 22, 2025
ATTRIBUTE_COUNT // Number of attribute kinds
};

// Flag masks for the ATTRIBUTE_PREVIEW_FLAGS attribute. Defined so
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, there might be a neater expression for these flags with:

bit: 1 0
    [0,0] 0 = normal_entry (only)
    [0,1] 1 = normal_entry_with_preview_version
    [1,0] 2 = preview_entry (only)
    [1,1] 3 = preview_entry_with_normal_version
       ^-- has other version bit
     ^---- is preview version bit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After remembering that these flags are also used in packages/xxx locations, where "is this a preview version" makes no conceptual sense, I no longer think it would be a good idea to change the flag definitions.

@mlbridge
Copy link

mlbridge bot commented Sep 22, 2025

Webrevs

FLAGS_HAS_PREVIEW_VERSION = 0x1,
// Set on all preview locations in "/modules/xxx/META-INF/preview/..."
FLAGS_IS_PREVIEW_VERSION = 0x2,
// Set on a preview location if no normal (non-preview) version of
Copy link
Contributor Author

@david-beaumont david-beaumont Sep 23, 2025

Choose a reason for hiding this comment

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

Also set on package directories if all its entries are preview only, but the C++ code doesn't need to know that because it's never dealing with those entries.

enum {
// Set on a "normal" (non-preview) location if a preview version of
// it exists in the same module.
FLAGS_HAS_PREVIEW_VERSION = 0x1,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also set on package directories if any of its entries have preview content.

@david-beaumont david-beaumont changed the title C++ preparation for preview mode [lworld] C++ preparation for preview mode Sep 23, 2025
@david-beaumont david-beaumont changed the title [lworld] C++ preparation for preview mode 8366093: [lworld] Add preview mode to C++ classloader Sep 23, 2025
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.

1 participant