RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v35]
Richard Reingruber
rrich at openjdk.org
Tue May 23 07:49:05 UTC 2023
On Tue, 23 May 2023 07:37:37 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
>> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Parameter Save Area is the correct name.
>
> src/hotspot/cpu/ppc/downcallLinker_ppc.cpp line 163:
>
>> 161: // The Parameter Save Area needs to be at least 8 slots for ABIv1.
>> 162: // ABIv2 allows omitting it when all parameters can get passed in registers. We currently don't optimize this.
>> 163: // For ABIv2, we only need (_input_registers.length() > 8) ? _input_registers.length() : 0
>
> The PSA is also needed if the parameter list is variable in length. Is the expression `(_input_registers.length() > 8) ? _input_registers.length() : 0` correct in that case too?
> Otherwise: `ABIv2 allows omitting it if the callee's prototype indicates that stack parameters are not expected. We currently don't optimize this.`
Ok, I see now. This is not obvious though. There are a few layers of abstraction at play which hide this. A comment is needed. Maybe like this:
```c++
// With ABIv1 a Parameter Save Area of at least 8 double words is always needed.
// ABIv2 allows omitting it if the callee's prototype indicates that stack parameters are not expected.
// We currently don't optimize this (see DowncallStubGenerator in the backend).
if (reg == null) return stack;
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/12708#discussion_r1201706335
More information about the core-libs-dev
mailing list