RFR: 8357267: ZGC: Handle APX EGPRs spilling in ZRuntimeCallSpill [v3]

Axel Boldt-Christmas aboldtch at openjdk.org
Mon May 26 12:13:56 UTC 2025


On Thu, 22 May 2025 17:42:06 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Patch spills APX EGPRs across runtime calls to slow-path barriers using PUSH2P/POP2 instructions with PPX hints.
>> These instructions operate over a pair of registers resulting into an smaller save/restoration JIT code, on the hind side they have hard alignment and balancing constraints, as they operate over 16-byte aligned stack address.
>> ZRuntimeCallSpill is agnostic to live register, thus resulting SPILL sequence should not modify the contents of the register.
>> 
>> Patch has been verified using Intel SDE all test under test/hotspot/jtreg/compiler/gcbarriers are green.
>> 
>> Kindly review and share your feedback.
>> 
>> Best Regards,
>> Jatin
>
> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comments resolution

Seems fine. Eventually it would be nice if we could generalise this and have the logic in the MacroAssembler. 

Just a small comment about the conditional rax push and pop.

src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp line 196:

> 194:         __ movptr(_result, rax);
> 195:         __ popp(rax);
> 196:       }

Same here.
Suggestion:

      if (_result != rax) {
        if (_result != nullptr) {
          __ movptr(_result, rax);
        }
        __ popp(rax);
      }

src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp line 211:

> 209:         __ movptr(_result, rax);
> 210:         __ pop(rax);
> 211:       }

Was unsure if we should change the behaviour in the else branch in this PR. But it seems like an alright change. However, I think it is easier to see that this does the correct thing if the condition for pushing and popping are the same.

Suggestion:

      if (_result != rax) {
        if (_result != noreg) {
          __ movptr(_result, rax);
        }
        __ pop(rax);
      }

-------------

Changes requested by aboldtch (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25351#pullrequestreview-2868218162
PR Review Comment: https://git.openjdk.org/jdk/pull/25351#discussion_r2107199288
PR Review Comment: https://git.openjdk.org/jdk/pull/25351#discussion_r2107197141


More information about the hotspot-dev mailing list