[foreign-memaccess+abi] RFR: 8255903: Enable multi-register return values for native invokers [v4]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Fri Oct 29 12:45:36 UTC 2021
On Fri, 29 Oct 2021 12:20:50 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Hi,
>>
>> This patch implements support for multi-register returns in native invokers, and removes the buffered invocation strategy for downcalls. This is achieved, essentially, by using an in memory return: the caller allocates a bit of memory, and the native invoker stub writes the values of the return register to that memory. Then, the post processing code reads the register values back from there.
>>
>> Currently, the target address of a downcall is handled separately from the other arguments. I initially implemented passing the IMR address the same way, but I realized the removal of the buffered invocation strategy affords us a better way of doing things: we can just make the target address and the IMR address part of the normal calling sequence, and remove a bunch of special-casing code to handle these. We now just use a binding recipe to unbox these arguments and shuffle them into registers, and the ABIDescriptor tells the native invoker stub which registers to pick up these arguments from.
>>
>> Thanks,
>> Jorn
>
> Jorn Vernee has updated the pull request incrementally with six additional commits since the last revision:
>
> - Benchmark fix
> - Rename FunctionDescriptor methods again
> - Fix tests again
> - Rename imr -> needsReturnBuffer
> - Address small comments
> - Fix failing tests
Looks good
test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java line 52:
> 50: @OutputTimeUnit(TimeUnit.NANOSECONDS)
> 51: @Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign", "--enable-native-access=ALL-UNNAMED" })
> 52: public class Upcalls extends org.openjdk.bench.jdk.incubator.foreign.CLayouts {
Why all the qualified names?
-------------
Marked as reviewed by mcimadamore (Committer).
PR: https://git.openjdk.java.net/panama-foreign/pull/603
More information about the panama-dev
mailing list