eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 721 forks source link

JEP 454: Foreign Function & Memory API (Finalized) #17872

Closed ChengJin01 closed 8 months ago

ChengJin01 commented 1 year ago

See https://openjdk.org/jeps/454 with the following changes in terms of APIs which might affect our FFI implementation in Java after the updated code at https://github.com/eclipse-openj9/openj9/issues/16951 (Third Preview).

1.Provided a new linker option allowing clients to pass heap segments to downcall method handles 2.Introduced the Enable-Native-Access JAR-file manifest attribute, allowing code in executable JAR files to call restricted methods without having to use the --enable-native-access command-line option 3.Enabled clients to build C-language function descriptors programmatically, avoiding platform-specific constants 4.Improved support for variable-length arrays in native memory 5.Added support for arbitrary charsets for native strings

FYI: @tajila, @pshipton

ChengJin01 commented 1 year ago

According to the announcement for the FFI work at https://mail.openjdk.org/pipermail/panama-dev/2023-July/019510.html,

Of course, the fact that FFM API is headed for finalization doesn't mean 
that development on FFM API will stop. There are several enhancements 
(aside from "regular" performance fixes) that we have been discussing 
over the years which can be delivered as follow-up JEPs:

* Support for unsigned/complex types (needs Valhalla)
* Mapping between structs and records [12]
* Integration between Linker and JNI [13]
* Structured arenas (depends on finalization of StructuredTaskScope) [14]
* Pinning of heap segments

The listed work above which are related to FFI but interact with other features will be addressed in separate JEPs in the near future.

tajila commented 8 months ago

We have issues to track the remaining failures