JDK-8283462 : VMReg should encode stack locations as byte offsets instead of slots
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 19
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: aarch64
  • Submitted: 2022-03-21
  • Updated: 2022-03-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Blocks :  
Description
VMReg is used to abstract over different kinds of machine registers.

It is used among other things to encode calling conventions. See for instance in SharedRuntime::c_calling_convention.

However, since VMReg encodes stack locations as stack slots, it can not be used to encode calling conventions that might require more precise stack coordinates. The macos aarch64 ABI is such an ABI for instance.

Currently, trying to call a function through JNI that uses the problematic parts of the ABI results in a guarantee being triggered, resulting then in a VM crash.

To facilitate such ABIs, VMReg could be changed to encode stack locations as byte offsets instead of slots. This is mostly a case of changing how VMRegs that encode stack locations are interpreted by code in macro assembler and alike.