JDK-8315801 : [PPC64] JNI code should be more similar to the Panama implementation
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc
  • Submitted: 2023-09-06
  • Updated: 2024-01-04
  • Resolved: 2023-11-17
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.
JDK 22
22 b25Fixed
Related Reports
Relates :  
Description
The code for the JNI native wrappers and runtime calls (c_calling_convention) puts some arguments on the stack even though they are passed in registers. The Panama implementation doesn't do that and it seems to be unnecessary.

// Argument i for i > 8 is placed on the stack even if it's
// placed in a register (if it's a double arg). Aix disassembly
// shows that xlC places these float args on the stack AND in
// a register. This is not documented, but we follow this
// convention, too.

We should consider removing it. Other compilers don't do it, either (e.g. powerpc64 clang and gcc). Statement from IBM Open XL support regarding AIX:
"I think it is up to the JVM to take the same approach gcc did here and use the non xl-compat behaviour. They would need to ensure they are getting the parameter save area size correct (ie they still have to allocate the stack space the floats would be stored in - since that is required by the ABI) but not have to store anything to that stack storage and pass the arguments in registers only.  OpenXL will always retrieve the float value from the register (since gcc may not have stored the value to the stack either)."
Also see GCC xl-compat description:
https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html#index-mno-xl-compat

In addition, JDK-8308695 states that the Parameter Save Area is not needed in some cases when ABIv2 is used.
Comments
Changeset: 368e4f60 Author: Martin Doerr <mdoerr@openjdk.org> Date: 2023-11-17 11:49:21 +0000 URL: https://git.openjdk.org/jdk/commit/368e4f60a937f5cf6919c1dd41fc791b1f7bf205
17-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15599 Date: 2023-09-06 15:57:24 +0000
06-09-2023