[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:29:13 UTC 2020
On Wed, 16 Sep 2020 11:51:38 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java line 136:
>>
>>> 134: * the corresponding native stub will be deallocated.</p>
>>> 135: *
>>> 136: * <p>The method type of the target method handle is used for linking</p>
>>
>> I think we can leave this out
>
> @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`?
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/327
More information about the panama-dev
mailing list