RFR: 8287425: Remove unnecessary register push for MacroAssembler::check_klass_subtype_slow_path
Xiaolin Zheng
xlinzheng at openjdk.java.net
Fri May 27 09:26:00 UTC 2022
Hi team,

Some perf results show necessary 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](https://bugs.openjdk.java.net/browse/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](https://bugs.openjdk.java.net/browse/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.
I was wondering if this minor change could be sponsored?
This enhancement is raised on behalf of Wei Kuai <kuaiwei.kw at 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] https://github.com/openjdk/jdk/blob/de67e5294982ce197f2abd051cbb1c8aa6c29499/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp#L273-L284
[2] https://github.com/openjdk/jdk/commit/b8dbe8d8f650124b61a4ce8b70286b5b444a3316#diff-beb6684583b0a552a99bbe4b5a21828489a6d689b32a05e1a9af8c3be9f463c3R7441-R7444
[3] https://github.com/openjdk/jdk/commit/b8dbe8d8f650124b61a4ce8b70286b5b444a3316#diff-beb6684583b0a552a99bbe4b5a21828489a6d689b32a05e1a9af8c3be9f463c3R7466-R7477
[4] https://github.com/openjdk/jdk/commit/5c58d27aac7b291b879a7a3ff6f39fca25619103#diff-beb6684583b0a552a99bbe4b5a21828489a6d689b32a05e1a9af8c3be9f463c3L9347-L9361
-------------
Commit messages:
- Enhancement
Changes: https://git.openjdk.java.net/jdk/pull/8915/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8915&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8287425
Stats: 3 lines in 3 files changed: 0 ins; 0 del; 3 mod
Patch: https://git.openjdk.java.net/jdk/pull/8915.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/8915/head:pull/8915
PR: https://git.openjdk.java.net/jdk/pull/8915
More information about the hotspot-compiler-dev
mailing list