RFR: 8351158: Incorrect APX EGPR register save ordering

Jatin Bhateja jbhateja at openjdk.org
Tue Mar 4 12:14:27 UTC 2025


Currently, EGPR register save ordering[1] does not comply with the precomputed stack offsets[2]. This leads to incorrect register value reconstruction and various runtime clients using callee's RegisterMap like GC root set enumeration, de-optimization object reconstruction experience assertion failures due to unrecognizable oop pointer locations.

This issue was discovered during our internal validation of SPECjvm2008 worklets with -XX:+UseAPX runtime flag using Intel SDE tool.

Quick note on polling SafePoints :-
SafePointNode at polling sites like method return or [outer] loop latches are different from the ones associated with Call sites as we do not spill caller saved registers before them, hence runtime handling for rootset enumeration to detect the oop pointer addresses in last activation solely relies on the RegisterMap populated by reading the RegisterSaver stack dumps. 

Kindly review and share your feedback.

Best Regards,
Jatin

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp#L268
[2] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp#L105

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

Commit messages:
 - 8351158: Incorrect APX EGPR register save ordering

Changes: https://git.openjdk.org/jdk/pull/23895/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23895&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8351158
  Stats: 31 lines in 1 file changed: 13 ins; 14 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/23895.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23895/head:pull/23895

PR: https://git.openjdk.org/jdk/pull/23895


More information about the hotspot-compiler-dev mailing list