[foreign-memaccess+abi] RFR: 8255902: Enable stack arguments for native invokers & optimized upcall stubs [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Oct 19 11:20:09 UTC 2021


On Mon, 18 Oct 2021 12:24:37 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Hi,
>> 
>> This patch implements stack argument support in native invokers & optimized upcalls stubs.
>> 
>> The main changes needed are:
>> - allow passing a stack offset 'bias' to shuffling code in macro assembler, so that it can account for shadow space (only needed on x86_64 for now).
>> - implement missing stack to reg & reg to stack moves for float and double on AArch64
>> - add TestDowncallStack & TestUpcallStack, which are basically the same as TestDowncall & TestUpcall, but with 8 `long long` and 8 `double` prefix arguments which saturate the argument registers and makes the arguments that are being tested passed on the stack instead.
>> 
>> Thanks,
>> Jorn
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fold TestDown/UpcallStack into TestDown/Upcall to reduce code duplication

Looks good - very clever testing approach :-)

src/hotspot/cpu/x86/macroAssembler_x86.hpp line 217:

> 215: 
> 216:   // bias in bytes
> 217:   void move32_64(VMRegPair src, VMRegPair dst, Register tmp = rax, int in_stk_bias = 0, int out_stk_bias = 0);

I was about to ask if you needed to preserve current code semantics - and I see you did that by adding default parameters - I'd check with some HS engineer to see what the code guidelines are here.

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

Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/600


More information about the panama-dev mailing list