What should the relationship between ports and developers of large projects be?
Jorn Vernee
jorn.vernee at oracle.com
Mon May 30 10:19:05 UTC 2022
On 27/05/2022 17:24, Andrew Haley wrote:
> On 5/27/22 15:59, Maurizio Cimadamore wrote:
>> JEP 424 has already been integrated into mainline. As far as I know
>> there were no issues as a result of that integration, as the code for
>> the foreign API already has the required stubs so that it will compile
>> in all the ports (even though the `Linker` might not run, but that's ok,
>> at least until some effort is put into providing an implementation of
>> the `Linker` class in those ports).
>
> Yes, I see. So, it's up to the porters to set their own schedule for
> implementing the Linker class.
>
Yes, that's right.
The platform dependent parts of the linker API are currently specified
to throw an UnsupportedOperationException on unsupported native platforms.
The methods in question are:
- Linker::nativeLinker [1]
- VaList::empty [2]
- VaList::make [3]
- VaList::ofAddress [4]
There is also the Linker::defaultLookup method [5], but it can just
return an empty lookup as well. (although, it might already just work
due to the way it's implemented).
The intent is to keep things like that for the time being.
We might be able to provide a fallback implementation of Linker based on
libffi as well (I've started on a POC [6], but didn't get that far yet).
That won't cover VaList though. As far as I can see libffi doesn't
implement that.
In the future we will likely make these APIs required on all platforms
though (i.e. remove the UOE from the specification).
Jorn
[1]:
https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/foreign/Linker.html#nativeLinker()
[2]:
https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/foreign/VaList.html#empty()
[3]:
https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/foreign/VaList.html#make(java.util.function.Consumer,java.lang.foreign.MemorySession)
[4]:
https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/foreign/VaList.html#ofAddress(java.lang.foreign.MemoryAddress,java.lang.foreign.MemorySession)
[5]:
https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/foreign/Linker.html#defaultLookup()
[6]:
https://github.com/openjdk/panama-foreign/compare/foreign-memaccess+abi...JornVernee:Zero_Linker
More information about the jdk-dev
mailing list