[foreign-memaccess+abi] RFR: 8274602: Generalize UpcallStub into NativeSymbol
John Rose
john.r.rose at oracle.com
Tue Oct 5 17:06:45 UTC 2021
On Oct 5, 2021, at 7:34 AM, Maurizio Cimadamore <mcimadamore at openjdk.java.net<mailto:mcimadamore at openjdk.java.net>> wrote:
I've tweaked the API so that downcallHandle now accepts a `NativeSymbol` - which is what I should have done all along. Now all symbols generated by the API are safe - but the ones constructed by users are not (as they are backed by "random" addresses) - so I think it's fair to mark the symbol factory as restricted. With these API changes, we also gain a bit of robustness, as a `VaList` can no longer be passed "as is" as a target address to a downcall method handle. Sure, the user can still create a native symbol which contains the very valist address - but that seems more convoluted (and restricted).
I looks to me that the effect of this is to remove a foot-gun
or two from the user’s tool kit. Very nice; thank you for
working it out.
More information about the panama-dev
mailing list