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

8272566: [lworld] [AArch64] G1 write barrier slow path needs to save more registers #534

Closed
wants to merge 1 commit into from

Conversation

nick-arm
Copy link
Member

@nick-arm nick-arm commented Aug 18, 2021

We call MacroAssembler::store_heap_oop() when packing inline type
arguments in C1's scalarised entry point and that in turn uses the
interpreter's barrier set assembler for the write barrier. With G1GC
this can call into the runtime on the slow path, but it doesn't preserve
the call-clobbered registers, which include the Java argument registers.

This was fixed on x86 in JDK-8242210 and JDK-8251398 but I missed that
when I updated the AArch64 port earlier in the year. I haven't actually
seen any failures caused by this, but from looking at the generated
assembly it's certainly possible.

This patch saves only the argument registers, and only if Valhalla is
enabled (unlike x86 which saves all registers unconditionally). There
are 32 caller-saved registers on AArch64 so I wanted to avoid generating
many additional store/load instructions.


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8272566: [lworld] [AArch64] G1 write barrier slow path needs to save more registers

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/534/head:pull/534
$ git checkout pull/534

Update a local copy of the PR:
$ git checkout pull/534
$ git pull https://git.openjdk.java.net/valhalla pull/534/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 534

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/534.diff

…more registers

We call MacroAssembler::store_heap_oop() when packing inline type
arguments in C1's scalarised entry point and that in turn uses the
interpreter's barrier set assembler for the write barrier.  With G1GC
this can call into the runtime on the slow path, but it doesn't preserve
the call-clobbered registers, which include the Java argument registers.

This was fixed on x86 in JDK-8242210 and JDK-8251398 but I missed that
when I updated the AArch64 port earlier in the year.  I haven't actually
seen any failures caused by this, but from looking at the generated
assembly it's certainly possible.

This patch saves only the argument registers, and only if Valhalla is
enabled (unlike x86 which saves all registers unconditionally).  There
are 32 caller-saved registers on AArch64 so I wanted to avoid generating
many additional store/load instructions.
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 18, 2021

👋 Welcome back ngasson! A progress list of the required criteria for merging this PR into lworld 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 openjdk bot commented Aug 18, 2021

@nick-arm 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:

8272566: [lworld] [AArch64] G1 write barrier slow path needs to save more registers

Reviewed-by: thartmann

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 no new commits pushed to the lworld branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 (@TobiHartmann) 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).

@mlbridge
Copy link

@mlbridge mlbridge bot commented Aug 18, 2021

Webrevs

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Looks good to me.

@nick-arm
Copy link
Member Author

@nick-arm nick-arm commented Aug 18, 2021

/integrate

@openjdk openjdk bot added the sponsor label Aug 18, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 18, 2021

@nick-arm
Your change (at version 2054c04) is now ready to be sponsored by a Committer.

@TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Aug 18, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Aug 18, 2021

Going to push as commit b0219dc.

@openjdk
Copy link

@openjdk openjdk bot commented Aug 18, 2021

@TobiHartmann @nick-arm Pushed as commit b0219dc.

💡 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
2 participants