-
Notifications
You must be signed in to change notification settings - Fork 137
8373987: [lworld] exploded-image/test broken since disable patching (JDK-8373806) #1845
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
Conversation
|
👋 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 111 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. Possible candidates are the reviewers of this PR (@coleenp, @RogerRiggs) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
| JIMAGE_MODE_UNINITIALIZED = 0, | ||
| JIMAGE_MODE_DEFAULT = 1, | ||
| JIMAGE_MODE_ENABLE_PREVIEW = 2 | ||
| // PreviewMode status to control preview behaviour. JImage_file is unusable |
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.
Totally automated search & replace.
| return file_name; | ||
| } | ||
|
|
||
| // caller needs ResourceMark |
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.
Based on the code above. Both these should probably use stringStream and format specifiers according to several people. I don't want to do that in this PR though.
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.
As long as it doesn't have a buffer overrun, it's fine to fix later. It seems okay.
| assert(_exploded_entries != nullptr, "No exploded build entries present"); | ||
| assert(!CDSConfig::is_dumping_archive(), "CDS dumping doesn't support exploded build"); | ||
| stream = search_module_entries(THREAD, _exploded_entries, pkg_entry, file_name); | ||
| const char* preview_file_name = is_preview_enabled() ? create_preview_file_name(file_name) : nullptr; |
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.
Making this out here seems best, but I could also pass the flag in and make it in search_module_entries(), but that's called from two places, so the less complexity in there the better.
| jimage_init(enable_preview); | ||
| } | ||
| void ClassLoader::set_preview_mode(bool enable_preview) { | ||
| assert(Preview_mode == PREVIEW_MODE_UNINITIALIZED, "set_preview_mode must not be called twice"); |
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.
Don't check for jimage now since it won't be there when using exploded image.
| static char* get_canonical_path(const char* orig, Thread* thread); | ||
| static const char* file_name_for_class_name(const char* class_name, | ||
| int class_name_len); | ||
| // REVIEWER-NOTE: Where best to put this - it should be private! |
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.
I don't think this should be here, but several other "private looking" functions are in the public section so I'm not sure. Advice requested...
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.
Move it up to the private section.
| if (nullptr != preview_file_name) { | ||
| stream = e->open_stream(current, preview_file_name); | ||
| } | ||
| if (nullptr == stream) { | ||
| stream = e->open_stream(current, file_name); | ||
| } |
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.
Why not pass in the preview flag to search_module_entries (or use the global) and create and preview file name here?
Its better encapsulated, with a smaller scope knowing about META-INF.
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.
As I said in the comment, I could. I didn't because search_module_entries is called in two places, and the call for exploded image is the edge case. So passing just a "try this first" path without the logic of accessing the preview mode flag and building the preview path felt simpler for the normal case.
I can't use the global flag inside the method of course, because that triggers it in the non-exploded image case.
coleenp
left a comment
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.
This seems all right.
| static char* get_canonical_path(const char* orig, Thread* thread); | ||
| static const char* file_name_for_class_name(const char* class_name, | ||
| int class_name_len); | ||
| // REVIEWER-NOTE: Where best to put this - it should be private! |
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.
Move it up to the private section.
| return file_name; | ||
| } | ||
|
|
||
| // caller needs ResourceMark |
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.
As long as it doesn't have a buffer overrun, it's fine to fix later. It seems okay.
RogerRiggs
left a comment
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.
Looks fine.
|
A better version of the fix is: #1854 |
Hopefully a fix for preview mode with exploded images in classLoader.cpp.
I did a little renaming since now it's clear that "preview mode" isn't a thing that's limited only to a jimage being present.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1845/head:pull/1845$ git checkout pull/1845Update a local copy of the PR:
$ git checkout pull/1845$ git pull https://git.openjdk.org/valhalla.git pull/1845/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1845View PR using the GUI difftool:
$ git pr show -t 1845Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1845.diff
Using Webrev
Link to Webrev Comment