On Mon, 22 May 2023 21:49:27 GMT, Richard Reingruber <rr...@openjdk.org> wrote:

>> Martin Doerr has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 41 commits:
>> 
>>  - Adaptation for JDK-8308276.
>>  - Merge remote-tracking branch 'origin' into PPC64_Panama
>>  - Add comment about Register Save Area.
>>  - Replace abstract method useABIv2().
>>  - Cleanup imports, improve comments, updates from other platforms.
>>  - Add NONZERO check for downcall_stub_address_offset_in_bytes().
>>  - Replace NULL by nullptr.
>>  - libTestHFA: Add explicit type conversion to avoid build warning.
>>  - Add test case for passing a double value in a GP register. Use better 
>> instructions for moving between FP and GP reg. Improve comments.
>>  - Merge remote-tracking branch 'origin' into PPC64_Panama
>>  - ... and 31 more: https://git.openjdk.org/jdk/compare/939344b8...08a5c143
>
> src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/CallArranger.java 
> line 205:
> 
>> 203:                 stack = stackAlloc(4, 4);
>> 204:             } else {
>> 205:                 stack = stackAlloc(is32Bit ? 4 : 8, STACK_SLOT_SIZE);
> 
> This looks like a stack slot is always allocated. Please explain that for ABI 
> V2 this is actually only required if it is know from a prototype that not all 
> parameters can be passed in registers and that we plan to change this.

This basically computes the stack layout. We need to count all slots to get the 
right offset for the registers which actually get written on stack. The first 
such register will hit native_abi_minframe_size + 8 slots. If fewer registers 
are used, the counted stack slots will not be used.
The decision whether we allocate the Parameter Save Area or not is done in the 
downcall stub and doesn't depend on the stackAllocs.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/12708#discussion_r1201251283

Reply via email to