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

8281815: x86: Use short jumps in TIG::generate_slow_signature_handler #7475

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Feb 15, 2022

Similar to JDK-8281744, this change improves TemplateInterpreterGenerator::generate_slow_signature_handler: there are only a few moves between the jumps, and we can tell MacroAssembler those can be short. This code is used to process arguments after the slow call to VM, so the performance improvement is drowned by the call itself. This makes interpreter code a bit more compact, though.

Additional testing:

  • Linux x86_64 fastdebug hotspot:tier1
  • Linux x86_32 fastdebug hotspot:tier1

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8281815: x86: Use short jumps in TIG::generate_slow_signature_handler

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7475

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 15, 2022

👋 Welcome back shade! 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 Feb 15, 2022

@shipilev 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 Feb 15, 2022
@shipilev shipilev marked this pull request as ready for review February 15, 2022 09:45
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 15, 2022
@mlbridge
Copy link

mlbridge bot commented Feb 15, 2022

Webrevs

@shipilev
Copy link
Member Author

The GHA failure on x86_32 is new and unrelated: https://bugs.openjdk.java.net/browse/JDK-8281822

@reinrich
Copy link
Member

On s390, being CISC too, there are similar issues. We addressed them with NearLabel, branch_optimized, and compare_and_branch_optimized. They provide a higher level of abstraction which helps writing better code without knowing all the details, which at least I instantly forget after looking into the manual.

@shipilev
Copy link
Member Author

On s390, being CISC too, there are similar issues. We addressed them with NearLabel, branch_optimized, and compare_and_branch_optimized. They provide a higher level of abstraction which helps writing better code without knowing all the details, which at least I instantly forget after looking into the manual.

In x86 MacroAssembler there are jcc and jccb for this. When MacroAssembler can make jcc, it would, but that requires the jump target to be already bound, so that jump offset is already known. For forward jumps, though, MacroAssembler cannot know this, so in those cases we need to tell it explicitly. NearLabel looks like another way of doing so.

@reinrich
Copy link
Member

On s390, being CISC too, there are similar issues. We addressed them with NearLabel, branch_optimized, and compare_and_branch_optimized. They provide a higher level of abstraction which helps writing better code without knowing all the details, which at least I instantly forget after looking into the manual.

In x86 MacroAssembler there are jcc and jccb for this. When MacroAssembler can make jcc, it would, but that requires the jump target to be already bound, so that jump offset is already known. For forward jumps, though, MacroAssembler cannot know this, so in those cases we need to tell it explicitly. NearLabel looks like another way of doing so.

Yes it is another way of doing so. For me the intend is clearer. Also you can pass a NearLabel to an assembler method that takes a Label parameter and there you can optimize if the passed Label is actually a NearLabel.

@shipilev
Copy link
Member Author

Yes it is another way of doing so. For me the intend is clearer. Also you can pass a NearLabel to an assembler method that takes a Label parameter and there you can optimize if the passed Label is actually a NearLabel.

True. I would like to consider that out of scope for this PR, would you agree?

@reinrich
Copy link
Member

Yes it is another way of doing so. For me the intend is clearer. Also you can pass a NearLabel to an assembler method that takes a Label parameter and there you can optimize if the passed Label is actually a NearLabel.

True. I would like to consider that out of scope for this PR, would you agree?

Of course.

Copy link
Member

@reinrich reinrich left a comment

Choose a reason for hiding this comment

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

Changes seem fine.

Richard.

@openjdk
Copy link

openjdk bot commented Feb 17, 2022

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

8281815: x86: Use short jumps in TIG::generate_slow_signature_handler

Reviewed-by: rrich, dholmes, jiefu

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

  • d7f31d0: 8282077: PKCS11 provider C_sign() impl should handle CKR_BUFFER_TOO_SMALL error
  • d3749de: 8277488: Add expiry exception for Digicert (geotrustglobalca) expiring in May 2022
  • 3943c89: 8282044: [JVMCI] Export _sha3_implCompress, _md5_implCompress and aarch64::_has_negatives stubs to JVMCI compiler.
  • 7ce75af: 8255266: Update Public Suffix List to 3c213aa
  • cfbfd9b: 8282103: fix macosx-generic typo in ProblemList
  • 413bef6: 8282049: AArch64: Use ZR for integer zero immediate volatile stores
  • cf6984d: 8282086: Update jib profile to not set build to 0
  • f5120b7: 8282056: Clean up com.sun.tools.javac.util.GraphUtils
  • e336504: 8280866: SuppressWarnings does not work properly in package-info and module-info
  • e8224f7: 8282089: [BACKOUT] Parallel: Refactor PSCardTable::scavenge_contents_parallel
  • ... and 53 more: https://git.openjdk.java.net/jdk/compare/11f943d148e7bc8d931c382ff019b3e65a87432e...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 17, 2022
@shipilev
Copy link
Member Author

Anyone else? :)

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Seems quite reasonable based on the description.

Thanks,
David

Copy link
Member

@DamonFool DamonFool left a comment

Choose a reason for hiding this comment

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

Please also update the copy right year.

@shipilev
Copy link
Member Author

Thank you!

/integrate

@openjdk
Copy link

openjdk bot commented Feb 21, 2022

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

  • d7f31d0: 8282077: PKCS11 provider C_sign() impl should handle CKR_BUFFER_TOO_SMALL error
  • d3749de: 8277488: Add expiry exception for Digicert (geotrustglobalca) expiring in May 2022
  • 3943c89: 8282044: [JVMCI] Export _sha3_implCompress, _md5_implCompress and aarch64::_has_negatives stubs to JVMCI compiler.
  • 7ce75af: 8255266: Update Public Suffix List to 3c213aa
  • cfbfd9b: 8282103: fix macosx-generic typo in ProblemList
  • 413bef6: 8282049: AArch64: Use ZR for integer zero immediate volatile stores
  • cf6984d: 8282086: Update jib profile to not set build to 0
  • f5120b7: 8282056: Clean up com.sun.tools.javac.util.GraphUtils
  • e336504: 8280866: SuppressWarnings does not work properly in package-info and module-info
  • e8224f7: 8282089: [BACKOUT] Parallel: Refactor PSCardTable::scavenge_contents_parallel
  • ... and 53 more: https://git.openjdk.java.net/jdk/compare/11f943d148e7bc8d931c382ff019b3e65a87432e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 21, 2022
@openjdk openjdk bot closed this Feb 21, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 21, 2022
@openjdk
Copy link

openjdk bot commented Feb 21, 2022

@shipilev Pushed as commit d28b048.

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

@shipilev shipilev deleted the JDK-8281815-int-short-slow-signature-helper branch March 7, 2022 10:55
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
4 participants