-
Notifications
You must be signed in to change notification settings - Fork 5.9k
8337702: Use new ForwardExceptionNode to call StubRoutines::forward_exception_entry() #20437
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 kvn! A progress list of the required criteria for merging this PR into |
@vnkozlov 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 141 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 |
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.
Hi Vladimir.
This looks like a very nice solution. The code changes look ok as far a I can tell. However, I'm not really in a position to approve the patch as I am not very familiar with the details of the matcher and formssel code. Sorry.
Thank you, @adinn, for review. |
FYI: Also performed tier1-3 test on linux-riscv64. Result looks good. |
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.
Nice enhancement.
I noticed that TailJump
is in vmStructs.cpp, should ForwardException
be added as well?
@@ -16184,6 +16184,19 @@ instruct TailjmpInd(iRegPNoSpNoRfp jump_target, iRegP_R0 ex_oop) | |||
ins_pipe(pipe_class_call); | |||
%} | |||
|
|||
// Forward exception. | |||
instruct ForwardExceptionjmp() |
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.
instruct ForwardExceptionjmp() | |
instruct ForwardException() |
Same for other AD files.
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.
We can't use the same name for Mach node as for Ideal node:
src/hotspot/cpu/x86/x86_64.ad(12596) Syntax Error: :duplicate name ForwardException for instruction
Error Context: >>>(<<<)
src/hotspot/cpu/x86/x86_64.ad(12597) Syntax Error: :Identifier expected, but found '%{
match(ForwardEx[...]'.
Error Context: >>>%<<<{
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.
Ah, makes sense.
Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
Thank you, @RealFYang, for testing. |
Hi, @TobiHartmann I cleaned I kept name of Mach instructions unchanged (with |
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!
@@ -256,12 +256,11 @@ void GraphKit::gen_stub(address C_function, | |||
|
|||
assert (StubRoutines::forward_exception_entry() != nullptr, "must be generated before"); | |||
Node *exc_target = makecon(TypeRawPtr::make( StubRoutines::forward_exception_entry() )); |
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.
exc_target
is no longer used, so this should probably be removed
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.
removed
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.
Still good.
Thank you, Tobias |
/integrate |
Going to push as commit 99edb4a.
Your commit was automatically rebased without conflicts. |
Currently C2 uses
TailCall
node when it generates code to forward exception in C2 runtime stubs.StubRoutines::forward_exception_entry()
address is passed as constant and method pointer isNULL
:generateOptoStub.cpp#L258
On other hand TailCall mach node uses 2 registers as parameter which is hardcoded in
Matcher
: matcher.cpp#L828As result we waste two registers to pass constant and NULL.
Also incorrect relocation is used for such call because the address of
forward_exception
stub passed in register in mach node. When it is converted toAddress
forjmp
instruction the defaultexternal_word_type
relocation is used whenruntime_call_type
should be used. See discussion in PR JDK-8337396I added new ideal node
ForwardExceptionNode
to solve these issues. It is similar toRethrow
node (which mach node definition I used as template) but I kept it based onReturn
node similar toTailCall
node.Tested tier1-3,stress,xcomp
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20437/head:pull/20437
$ git checkout pull/20437
Update a local copy of the PR:
$ git checkout pull/20437
$ git pull https://git.openjdk.org/jdk.git pull/20437/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20437
View PR using the GUI difftool:
$ git pr show -t 20437
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20437.diff
Webrev
Link to Webrev Comment