Skip to content
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

8303153: Native interpreter frame missing mirror #13794

Closed
wants to merge 2 commits into from

Conversation

fbredber
Copy link
Contributor

@fbredber fbredber commented May 4, 2023

The mirror needs to be stored in the frame for native calls also on AArch64 and RISC-V (as it is on other platforms).
See JDK-8303153 for more info.
Passes tier1-5 tests on AArch64. Done basic tests on RISC-V using QEmu.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13794/head:pull/13794
$ git checkout pull/13794

Update a local copy of the PR:
$ git checkout pull/13794
$ git pull https://git.openjdk.org/jdk.git pull/13794/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13794

View PR using the GUI difftool:
$ git pr show -t 13794

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13794.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 4, 2023

👋 Welcome back fbredber! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented May 4, 2023

@fbredber The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label May 4, 2023
@fbredber fbredber marked this pull request as ready for review May 4, 2023 08:03
@openjdk openjdk bot added the rfr Pull request is ready for review label May 4, 2023
@mlbridge
Copy link

mlbridge bot commented May 4, 2023

Webrevs

@fbredber
Copy link
Contributor Author

fbredber commented May 4, 2023

I'd appreciate if @theRealAph and @RealFYang can have a look at this.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@openjdk
Copy link

openjdk bot commented May 4, 2023

@fbredber 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:

8303153: Native interpreter frame missing mirror

Reviewed-by: coleenp, fyang

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 168 new commits pushed to the master branch:

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, @RealFYang) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 4, 2023
Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Thanks for taking care of RISC-V at the same time.
I think it would be cleaner if we do following for the RISC-V part:

diff --git a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
index 3e0e94515fc..f8ce528634f 100644
--- a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
+++ b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
@@ -770,8 +770,10 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
   __ sd(x19_sender_sp, Address(sp, 9 * wordSize));
   __ sd(zr, Address(sp, 8 * wordSize));

-  // Get mirror
+  // Get mirror and store it in the frame as GC root for this Method*
   __ load_mirror(t2, xmethod, x15, t1);
+  __ sd(t2, Address(sp, 4 * wordSize));
+
   if (!native_call) {
     __ ld(t0, Address(xmethod, Method::const_offset()));
     __ lhu(t0, Address(t0, ConstMethod::max_stack_offset()));
@@ -779,9 +781,8 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
     __ slli(t0, t0, 3);
     __ sub(t0, sp, t0);
     __ andi(t0, t0, -16);
-    // Store extended SP and mirror
+    // Store extended SP
     __ sd(t0, Address(sp, 5 * wordSize));
-    __ sd(t2, Address(sp, 4 * wordSize));
     // Move SP out of the way
     __ mv(sp, t0);
   } else {
@@ -789,7 +790,6 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
     // an exception (see TemplateInterpreterGenerator::generate_throw_exception())
     __ sub(t0, sp, 2 * wordSize);
     __ sd(t0, Address(sp, 5 * wordSize));
-    __ sd(zr, Address(sp, 4 * wordSize));
     __ mv(sp, t0);
   }
 }

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me. Thanks for the update.
FYI: I have performed tier1-3 tests on linux-riscv64 board, result looks good.

@fbredber
Copy link
Contributor Author

fbredber commented May 8, 2023

Thanks for the review @coleenp and @RealFYang.
If no one else has anything to add, I'll integrate (as soon as I can get a sponsor).

@fbredber
Copy link
Contributor Author

fbredber commented May 8, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 8, 2023
@openjdk
Copy link

openjdk bot commented May 8, 2023

@fbredber
Your change (at version 6a8c18a) is now ready to be sponsored by a Committer.

@coleenp
Copy link
Contributor

coleenp commented May 8, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented May 8, 2023

Going to push as commit 5a259d8.
Since your change was applied there have been 175 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 8, 2023
@openjdk openjdk bot closed this May 8, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels May 8, 2023
@openjdk
Copy link

openjdk bot commented May 8, 2023

@coleenp @fbredber Pushed as commit 5a259d8.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
3 participants