-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8371458: [REDO] Remove exception handler stub code in C2 #28192
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: master
Are you sure you want to change the base?
Conversation
The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.
Change-Id: I596317ec6a364b341e4642636fa5cf08f87ed722
Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a
Change-Id: I5f5fd681ba699f96859180d984841dd6df8524b5
|
/contributor add @TheRealMDoerr |
|
👋 Welcome back ruben-arm! A progress list of the required criteria for merging this PR into |
|
@ruben-arm This change is no longer ready for integration - check the PR body for details. |
|
@ruben-arm |
|
@ruben-arm The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@TobiHartmann, I would appreciate it if you could initiate the extended testing for this PR. |
|
Sure, I submitted testing. |
|
@ruben-arm what was the issue in the original changes? |
|
@vnkozlov, the jdk/src/hotspot/cpu/x86/nativeInst_x86.hpp Line 584 in e34a831
That works when the check happens for an actual call site, as the post-call NOP sequence is always longer than 4 bytes. With the change, the distance between the entry point and end of code blob can now be just 2 bytes - consequently the 4-bytes read would read outside the code blob. I initially missed this issue - having incorrectly concluded that the 7bb4352 should address this issue by splitting the faulting read into two. It also adjusts the expected size of deoptimization handler stub code to 7 bytes in total instead of the incorrect estimate of 10 bytes. |
All testing passed. I leave it to the original reviewers to re-review. |
TheRealMDoerr
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.
I haven't checked the deopt handler size on x86. Otherwise, it still looks good to me.
| }; | ||
|
|
||
| bool check() const { return int_at(0) == 0x841f0f; } | ||
| bool check() const { return short_at(0) == 0x1f0f && short_at(2) == 0x0084; } |
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.
Maybe a comment would be nice.
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.
Thanks for the suggestion. Would the comments added at 20cc58a be suitable?
|
|
Thanks, @TobiHartmann, for the extra tests, and apologies for missing this in the original PR. @TheRealMDoerr, I will update the PR to add comments. I am exploring a possibility to add a unit test for this issue, but I have not identified a deterministic way to make the deopt handler stub end at a page boundary. |
|
/reviewers 2 reviewer |
|
@TobiHartmann |
|
I am planning to update this PR today to include the comments. |
The latest update implements an alternative way to detect the failure early during testing - via the newly added assertion in the @adinn, @dean-long, @TheRealMDoerr, would it be possible for you to review the latest version of the PR? Is there any additional testing you would recommend to perform before this can be integrated? |
TheRealMDoerr
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.
I think assertions would be sufficient in C1 instead of guarantee. But, ok. I'll put it into our test queue.
The original fix JDK-8365047 was backed out by JDK-8371388, this is the REDO.
The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob.
According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only.
Progress
Issue
Reviewers
Contributors
<mdoerr@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28192/head:pull/28192$ git checkout pull/28192Update a local copy of the PR:
$ git checkout pull/28192$ git pull https://git.openjdk.org/jdk.git pull/28192/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28192View PR using the GUI difftool:
$ git pr show -t 28192Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28192.diff
Using Webrev
Link to Webrev Comment