[foreign-abi] RFR: 8248560: Specify the behaviour of the ForeignLinker returned by CSupport::getSystemLinker [v4]

Jorn Vernee jvernee at openjdk.java.net
Wed Sep 16 12:54:48 UTC 2020


On Wed, 16 Sep 2020 12:20:08 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> @PaulSandoz mentioned (and I agree) that the terms upcalls and downcalls are colloquial, in the sense that it's
>> technically possible to pass an upcall stub to `downcallHandle`, so that it's no longer really making a downcall and,
>> conversely, it's possible to pass a native method handle to `upcallStub` so that it will not, strictly speaking,
>> execute an upcall to Java.  I think the real nature of what we're describing here is:
>> * given an address and a function descriptor, obtain a MethodHandle which can be used to execute the code at that address
>>   from Java code
>> 
>> * given a MethodHandle and a function descriptor, obtain a memory segment, whose base address can be passed to native
>>   code where a function pointer is expected
>> 
>> I don't know if the terms downcallHandle and upcallStub are the best to describe what these do.
>
> Maybe we can incorporate 'link' in the name? Since we're using CLinker as a name as well. Maybe we can call them:
> `linkForeignFunction` or maybe `linkAddress` and `linkMethodHandle`?

I'll save the rename of the methods for later, and integrate this so that the refactor can go through.

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

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


More information about the panama-dev mailing list