[foreign-memaccess+abi] RFR: 8275332: Variadic functions don't work on Linux/AArch64
Andrew Haley
aph at openjdk.java.net
Tue Oct 19 11:08:57 UTC 2021
On Tue, 19 Oct 2021 08:54:24 GMT, Nick Gasson <ngasson at openjdk.org> wrote:
> Variable length argument lists are handled differently in the
> Mac/Windows and Linux ABIs on AArch64. Following the recent API refresh
> on the foreign-memaccess+abi branch the Mac behaviour was inadvertently
> applied on Linux too. This patch restores the correct behaviour on
> Linux and adds a CallArranger unit test so regressions can be more
> easily caught.
>
> I just added an extra varArgsOnStack argument to
> CallArranger.getBindings() as that seemed the simplest fix, although it
> could get unwieldy if there were too many configurable options.
The way the boolean `varArgsOnStack` is used here, being passed through multiple calls, is kinda awful, being error prone and confusing to the reader. Given that the on-stack property is fixed by the ABI, can you not handle it with an appropriate subclass?
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/601
More information about the panama-dev
mailing list