Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8315801

[PPC64] JNI code should be more similar to the Panama implementation



    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • 22
    • hotspot
    • 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:

      In addition, JDK-8308695 states that the Parameter Save Area is not needed in some cases when ABIv2 is used.


        Issue Links



              mdoerr Martin Doerr
              mdoerr Martin Doerr
              0 Vote for this issue
              3 Start watching this issue