RFR: 8357267: ZGC: Handle APX EGPRs spilling in ZRuntimeCallSpill

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Fri May 23 13:55:57 UTC 2025


On Thu, 22 May 2025 13:30:28 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> > > Patch has been verified using Intel SDE all test under test/hotspot/jtreg/compiler/gcbarriers are green.
> > 
> > 
> > Have you checked that these tests exercise `ZRuntimeCallSpill` significantly? Most tests in that directory seem to exercise C2's generated ZGC barriers, which use other spilling/restoring logic across runtime calls (`SaveLiveRegisters`). Also, I expect the register pressure in these test cases to be minimal, so it could be good to randomize register assignment to improve the testing effectiveness. Finally, `ZRuntimeCallSpill` is typically used in slow paths, which are rarely exercised in short-lived test cases. Have you considered altering the users of `ZRuntimeCallSpill` so that they are forced to always, or at least more often, enter the slow path, for testing purposes? [This PR](https://github.com/openjdk/jdk/pull/18967) did something similar in the context of C2 ZGC barriers.
> 
> Intel SDE allows us to collect execution traces with _-itrace_execute_emulate_ and we found quite a lot of register save/ restorations around native method, there is already an existing test point for it https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/gcbarriers/UnsafeIntrinsicsTest.java

OK, thanks for checking Jatin!

Have you also checked whether, at least in some of the cases, some of the APX EGPRs are live across the runtime call (i.e. are defined before the call and used after the call), and whether the called runtime routine typically clobbers these registers? Knowing that this case is exercised in the test runs would be good to be confident about the correctness of the patch.

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

PR Comment: https://git.openjdk.org/jdk/pull/25351#issuecomment-2904504259


More information about the hotspot-dev mailing list