Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8287425

Remove unnecessary register push for MacroAssembler::check_klass_subtype_slow_path

    XMLWordPrintable

Details

    • b58
    • b26
    • generic
    • linux

    Backports

      Description

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

        Some perf results show unnecessary pushes in MacroAssembler::check_klass_subtype_slow_path() under UseCompressedOops. History logs shows 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 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.

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

        [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

        Attachments

          Issue Links

            Activity

              People

                xlinzheng Xiaolin Zheng
                xlinzheng Xiaolin Zheng
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: