-
Enhancement
-
Resolution: Fixed
-
P4
-
22
-
b25
-
ppc
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.
// 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,
- relates to
-
JDK-8308695 PPC64: The Parameter Save Area for ABIv2 calls is in most cases redundant
-
- Closed
-