-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8357619: [JVMCI] Revisit phantom_ref parameter in JVMCINMethodData::get_nmethod_mirror #25488
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 dnsimon! A progress list of the required criteria for merging this PR into |
|
@dougxc 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 103 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. ➡️ To integrate this PR with the above commit message to the |
| // Only the mirror in the HotSpot heap is accessible | ||
| // through JVMCINMethodData | ||
| oop nmethod_mirror = data->get_nmethod_mirror(nm, /* phantom_ref */ true); | ||
| oop nmethod_mirror = data->get_nmethod_mirror(nm); |
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.
Is the nmethod guaranteed to be on-stack here? If not it gotta be phantom.
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.
Is the use of JVMCINMethodHandle equivalent to nm being on-stack?
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.
Yes. Great, so that should be fine then.
Webrevs
|
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 good.
| void JVMCINMethodData::invalidate_nmethod_mirror(nmethod* nm) { | ||
| oop nmethod_mirror = get_nmethod_mirror(nm, /* phantom_ref */ false); | ||
| if (nmethod_mirror == nullptr) { | ||
| if (_nmethod_mirror_index == -1) { |
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 part is actually wrong as that's the first part of get_nmethod_mirror and we must always check that get_nmethod_mirror doesn't return nullptr. I'd assumed that the mirror was always non-null if _nmethod_mirror_index != -1 but that's not true. The slot is reserved for all non-default nmethods and must stay around so that translate can work.
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.
Fixed: 7456988
| oop nmethod_mirror = get_nmethod_mirror(nm, /* phantom_ref */ false); | ||
| oop nmethod_mirror = get_nmethod_mirror(nm); | ||
| if (nmethod_mirror == nullptr) { | ||
| return; |
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.
minor typo
|
Thanks for the reviews. /integrate |
|
Going to push as commit 6cfd405.
Your commit was automatically rebased without conflicts. |
The point of the
phantom_refparameter (introduced by JDK-8234359) ofJVMCINMethodData::get_nmethod_mirroris to avoid the special resurrection semantics of a phantom read when reading the field during GC, which is whenJVMCINMethodData::invalidate_nmethod_mirrorcan be called.This case can be handled directly in
JVMCINMethodData::invalidate_nmethod_mirrorand so thephantom_refparameter can be removed.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25488/head:pull/25488$ git checkout pull/25488Update a local copy of the PR:
$ git checkout pull/25488$ git pull https://git.openjdk.org/jdk.git pull/25488/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25488View PR using the GUI difftool:
$ git pr show -t 25488Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25488.diff
Using Webrev
Link to Webrev Comment