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

8287425: Remove unnecessary register push for MacroAssembler::check_klass_subtype_slow_path #8915

Closed
wants to merge 1 commit into from

Conversation

zhengxiaolinX
Copy link
Contributor

@zhengxiaolinX zhengxiaolinX commented May 27, 2022

Hi team,

AE98A8E7-9F6F-4722-B310-299A9A96A957

Some perf results show unnecessary pushes in MacroAssembler::check_klass_subtype_slow_path() under UseCompressedOops. History logs show the original code is like [1], and it gets refactored in JDK-6813212, and the counterparts of the UseCompressedOops in the diff are at [2] and [3], and we could see the push of rax is just because encode_heap_oop_not_null() would kill it, so here needs a push and restore. After that, JDK-6964458 (removal of perm gen) at [4] removed [3] so that there is no need to do UseCompressedOops work in MacroAssembler::check_klass_subtype_slow_path(); but in that patch [2] didn't get removed, so we finally come here. As a result, [2] could also be safely removed.

(Files in [4] are folded because the patch is too large. We could manually unfold hotspot/src/cpu/x86/vm/assembler_x86.cpp to see that diff)

I was wondering if this minor change could be sponsored?

This enhancement is raised on behalf of Wei Kuai kuaiwei.kw@alibaba-inc.com.

Tested x86_64 hotspot tier1~tier4 twice, aarch64 hotspot tier1~tier4 once with another jdk tier1 once, and riscv64 hotspot tier1~tier4 once.

Thanks,
Xiaolin

[1]

if (UseCompressedOops) {
push(rax);
encode_heap_oop(rax);
repne_scanl();
// Not equal?
jcc(Assembler::notEqual, not_subtype_pop);
// restore heap oop here for movq
pop(rax);
} else {
repne_scan();
jcc(Assembler::notEqual, not_subtype);
}

[2] b8dbe8d#diff-beb6684583b0a552a99bbe4b5a21828489a6d689b32a05e1a9af8c3be9f463c3R7441-R7444
[3] b8dbe8d#diff-beb6684583b0a552a99bbe4b5a21828489a6d689b32a05e1a9af8c3be9f463c3R7466-R7477
[4] 5c58d27#diff-beb6684583b0a552a99bbe4b5a21828489a6d689b32a05e1a9af8c3be9f463c3L9347-L9361


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

  • JDK-8287425: Remove unnecessary register push for MacroAssembler::check_klass_subtype_slow_path

Reviewers

Contributors

  • Wei Kuai <kuaiwei.kw@alibaba-inc.com>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8915

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented May 27, 2022

👋 Welcome back xlinzheng! 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 openjdk bot added the rfr Pull request is ready for review label May 27, 2022
@openjdk
Copy link

openjdk bot commented May 27, 2022

@zhengxiaolinX 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 27, 2022
@zhengxiaolinX
Copy link
Contributor Author

/label hotspot-compiler
/label remove hotspot

/contributor add Wei Kuai kuaiwei.kw@alibaba-inc.com

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label May 27, 2022
@openjdk
Copy link

openjdk bot commented May 27, 2022

@zhengxiaolinX
The hotspot-compiler label was successfully added.

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label May 27, 2022
@openjdk
Copy link

openjdk bot commented May 27, 2022

@zhengxiaolinX
The hotspot label was successfully removed.

@openjdk
Copy link

openjdk bot commented May 27, 2022

@zhengxiaolinX
Contributor Wei Kuai <kuaiwei.kw@alibaba-inc.com> successfully added.

@mlbridge
Copy link

mlbridge bot commented May 27, 2022

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Looks good. I would consider it as trivial fix.

@openjdk
Copy link

openjdk bot commented May 27, 2022

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

8287425: Remove unnecessary register push for MacroAssembler::check_klass_subtype_slow_path

Co-authored-by: Wei Kuai <kuaiwei.kw@alibaba-inc.com>
Reviewed-by: kvn

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

  • 6ff2d89: 8287496: Alternative virtual thread implementation that maps to OS thread
  • 199832a: 8283466: C2: missing skeleton predicates in peeled loop
  • a82417f: 8233269: Improve handling of JAVA_ARGS
  • d7341ae: 8286846: test/jdk/javax/swing/plaf/aqua/CustomComboBoxFocusTest.java fails on mac aarch64
  • 07d2450: 8213531: Test javax/swing/border/TestTitledBorderLeak.java fails
  • 6030c0e: 8287118: Use monospace font for annotation default values
  • 72bcf2a: 4511638: Double.toString(double) sometimes produces incorrect results
  • 2f19144: 8282024: add EscapeAnalysis statistics under PrintOptoStatistics
  • cdb4768: 8287396: LIR_Opr::vreg_number() and data() can return negative number
  • 4caf1ef: 8287390: Cleanup Map usage in AuthenticationInfo.requestAuthentication
  • ... and 150 more: https://git.openjdk.java.net/jdk/compare/c156bcc599534ae989bc9cbd001e7c150da8096c...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.

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 (@vnkozlov) 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 27, 2022
@zhengxiaolinX
Copy link
Contributor Author

zhengxiaolinX commented May 31, 2022

Gentle ping - maybe another review of this? For this may change different platforms.
(If not, I would integrate this before ramp-down in days.)

@zhengxiaolinX
Copy link
Contributor Author

Thank you for reviewing, Vladimir! Then I'd merge this trivial enhancement if no other comments.

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 2, 2022
@openjdk
Copy link

openjdk bot commented Jun 2, 2022

@zhengxiaolinX
Your change (at version 7672d2f) is now ready to be sponsored by a Committer.

@vnkozlov
Copy link
Contributor

vnkozlov commented Jun 2, 2022

Let me test it first.

@vnkozlov
Copy link
Contributor

vnkozlov commented Jun 2, 2022

Testing passed.

@vnkozlov
Copy link
Contributor

vnkozlov commented Jun 2, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 2, 2022

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

  • 26048ea: 8287695: Use String.contains() instead of String.indexOf() in jdk.hotspot.agent
  • 37e1835: 8287746: ProblemList jni/nullCaller/NullCallerTest.java
  • 26d2426: 8287340: Refactor old code using StringTokenizer in locale related code
  • ccec5d1: 8287704: Small logging clarification about shrunk bytes after heap shrinkage
  • 7f44f57: 8285868: x86 intrinsics for floating point method isInfinite
  • 13596cd: 8287097: (fs) Files::copy requires an undocumented permission when copying from the default file system to a non-default file system
  • 49e24f0: 8287567: AArch64: Implement post-call NOPs
  • 1fcbaa4: 8278598: AlignmentReserve is repeatedly reinitialized
  • e51ca1d: 8287171: Refactor null caller tests to a single directory
  • 3cfd38c: 8287726: Fix JVMTI tests with "requires vm.continuations" after JDK-8287496
  • ... and 163 more: https://git.openjdk.java.net/jdk/compare/c156bcc599534ae989bc9cbd001e7c150da8096c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 2, 2022
@openjdk openjdk bot closed this Jun 2, 2022
@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 Jun 2, 2022
@openjdk
Copy link

openjdk bot commented Jun 2, 2022

@vnkozlov @zhengxiaolinX Pushed as commit b5a646e.

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

@zhengxiaolinX zhengxiaolinX deleted the compressedoops branch June 3, 2022 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
2 participants