Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ChengJin01 opened this issue Jul 27, 2023 · 2 comments
Closed

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

ChengJin01 opened this issue Jul 27, 2023 · 2 comments
Assignees
Labels
comp:vm jdk22 JEP project:panama Used to track Project Panama related work

Comments

@ChengJin01
Copy link

ChengJin01 commented Jul 27, 2023

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 #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 ChengJin01 added project:panama Used to track Project Panama related work jdk22 comp:vm JEP labels Jul 27, 2023
@ChengJin01 ChengJin01 self-assigned this Jul 27, 2023
@ChengJin01
Copy link
Author

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.

@ChengJin01 ChengJin01 changed the title JEP draft: Foreign Function & Memory API (Finalized) JEP 454: Foreign Function & Memory API (Finalized) Sep 11, 2023
@pshipton pshipton added this to the Java 22 milestone Jan 5, 2024
ChengJin01 pushed a commit to ChengJin01/openj9 that referenced this issue Feb 20, 2024
The changes aim to pass the heap arguments
to native when the linker option intended
for the critical downcall is specified.

Note:
The feature implemented in this PR is specified 
in JEP454/JDK22 at eclipse-openj9#17872

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
ChengJin01 pushed a commit to ChengJin01/openj9 that referenced this issue Feb 23, 2024
The changes aim to pass the heap arguments
to native when the linker option intended
for the critical downcall is specified.

Note:
The feature implemented in this PR is specified 
in JEP454/JDK22 at eclipse-openj9#17872

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
@tajila
Copy link
Contributor

tajila commented Mar 11, 2024

We have issues to track the remaining failures

@tajila tajila closed this as completed Mar 11, 2024
ChengJin01 pushed a commit to ChengJin01/openj9 that referenced this issue Apr 3, 2024
The changes aim to address the case of discontiguous heap
array in the critical downcall by copying the heap array
to a native memory given the passed-in array in the native
function must be a contiguous one for native access.

Related: eclipse-openj9#17872

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
ChengJin01 pushed a commit to ChengJin01/openj9 that referenced this issue Apr 4, 2024
The changes aim to address the case of discontiguous heap
array in the critical downcall by copying the heap array
to a native memory given the passed-in array in the native
function must be a contiguous one for native access.

Related: eclipse-openj9#17872

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
ChengJin01 pushed a commit to ChengJin01/openj9 that referenced this issue Apr 11, 2024
The changes aim to address the case of discontiguous heap
array in the critical downcall by copying the heap array
to a native memory given the passed-in array in the native
function must be a contiguous one for native access.

Related: eclipse-openj9#17872

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm jdk22 JEP project:panama Used to track Project Panama related work
Projects
None yet
Development

No branches or pull requests

3 participants