Skip to content

Conversation

@r30shah
Copy link
Contributor

@r30shah r30shah commented Oct 30, 2025

Call from JIT compiled code to JIT helper functions implemented in C
is made using S390CHelperLinkage which prepares the call dispatch
sequecne following the fast XPLINK ABI on z/OS. As per XPLINK GPR15 is
preserved register. In case of Synchronized Virtual Thread, a virtual
thread trying to enter a monitor can be unmounted from the carrier
thread if monitor is bloked, in such it can be mounted to different
carrier thread. From JIT compiled code, such task is done through the
C helper function, where upon mounting, return back to JIT compiled
code would happen from interpreter. For such case, GPR15 is used to
branch back from interpreter. To ensure we do not have any live values
in GPR15, changes in this commit marks GPR15 volatile for
S390CHelperLinkage on 64-bit z/OS. Given that only in case of
synchronized virtual thread which would only available in JDK24 and
newer which is not available on 31-bit JVM, this change is kept
limited to 64-bit z/OS.

Call from JIT compiled code to JIT helper functions implemented in C
is made using S390CHelperLinkage which prepares the call dispatch
sequecne following the fast XPLINK ABI on z/OS. As per XPLINK GPR15 is
preserved register. In case of Synchronized Virtual Thread, a virtual
thread trying to enter a monitor can be unmounted from the carrier
thread if monitor is bloked, in such it can be mounted to different
carrier thread. From JIT compiled code, such task is done through the
C helper function, where upon mounting, return back to JIT compiled
code would happen from interpreter. For such case, GPR15 is used to
branch back from interpreter. To ensure we do not have any live values
in GPR15, changes in this commit marks GPR15 volatile for
S390CHelperLinkage on 64-bit z/OS. Given that only in case of
synchronized virtual thread which would only available in JDK24 and
newer which is not available on 31-bit JVM, this change is kept
limited to 64-bit z/OS.

Signed-off-by: Rahil Shah <[email protected]>
@r30shah r30shah changed the title Use GPR14 as JUMP Reg for private linkage Mark GPR15 volatile for JIT Helper calls on 64-bit z/OS Nov 4, 2025
@r30shah r30shah marked this pull request as ready for review November 4, 2025 15:23
@r30shah
Copy link
Contributor Author

r30shah commented Nov 4, 2025

@joransiu - Can I get your review on this change? I have looked into the failure due to which we needed to #22833.
They were limited to 31-Bit z/OS only. We have ICF in OOL before helper call in checkcast and monitorEntry/Exit evaluators which stresses our RA by using all the GPRs in ICF combined with the dispatch dependencies, So all except preserved and locked registers have been used. So when I had GPR15 marked volatile as well on 31-bit z/OS we ran out of registers given we need to free up GPR12 as well for CAA on 31-bit z/OS.

Changes in the evaluators to limit the registers in ICF / move the ICF out of OOL and keep only helper call in OOL would be lot more invasive and performance sensitive, so having change limited to 64-bit z/OS for now should have minimal impact.

Apart from revisit to linkage to find a good synergy for such transition, I am adding some refactoring to minimize RA pressure in our evaluator as tasks to be picked up later.

@joransiu
Copy link
Member

joransiu commented Nov 4, 2025

jenkins test sanity zlinux jdk21

@joransiu joransiu merged commit 486d456 into eclipse-openj9:master Nov 4, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants