-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8312522: Implementation of Foreign Function & Memory API #15103
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
Conversation
Reviewed-by: jvernee
Reviewed-by: jvernee
Reviewed-by: jvernee
Reviewed-by: mcimadamore
Reviewed-by: jvernee
Reviewed-by: mcimadamore
Reviewed-by: jvernee
8310646: Javadoc around prototype-less functions might be incorrect Reviewed-by: mcimadamore
Reviewed-by: mcimadamore
Reviewed-by: mcimadamore
Reviewed-by: mcimadamore
Reviewed-by: mcimadamore
Reviewed-by: mcimadamore
👋 Welcome back jvernee! A progress list of the required criteria for merging this PR into |
@JornVernee The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
/label remove shenandoah |
/label add hotspot-compiler |
@JornVernee |
@JornVernee |
/contributor add @mcimadamore |
@JornVernee |
/jep JDK-8310626 |
Maybe include openjdk/panama-foreign#864? |
The leftover implementation-only changes will be ported over separately. |
I've addressed a test failure in b4a7b7a that was found after merging this patch with the most recent master branch. The test in questions checks for linter warnings for restricted methods. It depends on the FFM API for that, which is still preview in the master branch, but no longer preview as part of this patch. Hence the warnings the compiler outputs are different, and the test fails. I've fixed to test. The preview flags are no longer needed. |
@JornVernee This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 67 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 32ac72c.
Your commit was automatically rebased without conflicts. |
@JornVernee Pushed as commit 32ac72c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This patch contains the implementation of the foreign linker & memory API JEP for Java 22. The initial patch is composed of commits brought over directly from the panama-foreign repo. The main changes found in this patch come from the following PRs:
java.nio.charset.StandardCharsets
class.MemoryLayout::sequenceLayout
factory method which inferred the size of the sequence to beLong.MAX_VALUE
, as this led to confusion among clients. A client is now required to explicitly specify the sequence size.Linker::canonicalLayouts
, which exposes a map containing the platform-specific mappings of common C type names to memory layouts.SegmentAllocator::allocateArray
, by renaming methods that both allocate + initialize memory segments toallocateFrom
. (see the original PR for the problematic case)jdk_foreign
tests can pass on 32-bit machines, taking linux-x86 as a test bed.Linker::nativeLinker
method is not longer allowed to throw anUnsupportedOperationException
on unsupported platforms. All tests are turned on by default, instead of being skipped when the linker is not present.@PreviewFeature
annotations from the API. Update all@since
tags in the Javadoc to@since 22
(per JEP 12). Update tests and benchmarks to no longer build and run using--enable-preview
(or the@enablePreview
jtreg tag).I want to call out in particular that this patch finalizes the FFM API (by moving it out of preview), and requires all JDK implementations to implement it. Most ports already have full FFM API support. The ones that are missing are: s390 (currently under review), windows-x86 (deprecated for removal), and linux-86 & arm32 (which can both be implemented using the fallback linker 1 2).
Testing: tier 1-5
Progress
Issues
Reviewers
Contributors
<mcimadamore@openjdk.org>
<jvernee@openjdk.org>
<pminborg@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15103/head:pull/15103
$ git checkout pull/15103
Update a local copy of the PR:
$ git checkout pull/15103
$ git pull https://git.openjdk.org/jdk.git pull/15103/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15103
View PR using the GUI difftool:
$ git pr show -t 15103
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15103.diff
Webrev
Link to Webrev Comment