[foreign-abi] RFR: 8249803: Add LibraryLookup.Symbol
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Tue Jul 21 15:40:36 UTC 2020
On Tue, 21 Jul 2020 15:17:26 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> This patch adds the LibraryLookup.Symbol, which implements Addressable, and that is returned on a successful symbol
>> lookup. This patch also tweaks VaList to also implement the Addressable interface (VaList already had an `address()`
>> method). The `ForeignLinker::downcallHandle` method has been tweaked to accept an Addressable as a function entry
>> point. This allows downcall handle to target not only native symbols, but also upcall stubs (since upcall stubs are
>> segments, which are addressable) as well as native memory addresses. Some tests needed minor tweaks.
>
> src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableInvoker.java line 116:
>
>> 115:
>> 116: this.addr = addr.address();
>> 117: this.callingSequence = callingSequence;
>
> Don't think this will keep the reference to the LibraryLookup alive. I think you need to save the Addressable, and then
> convert to MA on demand, or use 2 fields (or maybe you have a better idea).
Gosh - you are right; what I did in the addressable patch was to store the addressable as-is in the programmable
invoker field; I should just do that.
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/256
More information about the panama-dev
mailing list