-
Notifications
You must be signed in to change notification settings - Fork 124
8366093: [lworld] Add preview mode to C++ classloader #1618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: lworld
Are you sure you want to change the base?
Conversation
This is a new version of #1609, re-created so there's now a pr/xxx branch for use by dependent PRs. |
👋 Welcome back david-beaumont! A progress list of the required criteria for merging this PR into |
@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:
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 247 new commits pushed to the
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 |
enum { | ||
// Set on a "normal" (non-preview) location if a preview version of | ||
// it exists in the same module. | ||
FLAGS_HAS_PREVIEW_VERSION = 0x1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid confusion, the value and spelling of the flag should agree across all modules.
In ImageLocation and jimage/ModulesReference.
// Flag masks for the ATTRIBUTE_PREVIEW_FLAGS attribute. Defined so | ||
// that zero is the overwhelmingly common case for normal resources. | ||
enum { | ||
// Set on a "normal" (non-preview) location if a preview version of | ||
// it exists in the same module. | ||
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 | ||
// it exists in the same module. | ||
FLAGS_IS_PREVIEW_ONLY = 0x4 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A refactoring of the flags can avoid conflicting states.
FLAGS_IS_PREVIEW_VERSION = 2; // set for preview version
FLAGS_NO_NORMAL_VERSION = 1; // preserving the zero value for normal and no preview.
Create static methods in ImageLocation to perform the desired tests on flags.
The utility methods make the code easier to read.
Also define macros/function in the native code in ImageFile and jimage.
isPreviewVersion(flags) { return (flags & FLAGS_IS_PREVIEW_VERSION) != 0)}
isPreviewOnly(flags) { return (flags & FLAGS_IS_REVIEW_VERSION | FLAGS_NO_NORMAL_VERSION) == FLAGS_NO_NORMAL_VERSION}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reprise:
Your name FLAGS_IS_PREVIEW_ONLY probably better than FLAGS_NO_NORMAL_VERSION and has the same semantics.
FLAGS_HAS_PREVIEW_VERSION means that there is a preview version and it will be found in the <META-INF/Preview> hierarchy. if the flag is in the preview node then this is it. If found in the normal hierarchy, the preview class is found in the <META-INF/Preview> hierarchy.
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
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1618/head:pull/1618
$ git checkout pull/1618
Update a local copy of the PR:
$ git checkout pull/1618
$ git pull https://git.openjdk.org/valhalla.git pull/1618/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1618
View PR using the GUI difftool:
$ git pr show -t 1618
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1618.diff
Using Webrev
Link to Webrev Comment