Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

[JEP424] Implement the Linker's downcall & upcall handler in Java19 #5

Conversation

ChengJin01
Copy link

The changes aim to enable the Linker's downcall & upcall handler
to support primitives and struct by replacing DowncallLinker
& UpcallLinker with the equivalent implemented in OpenJ9.
In addition, the changes also include the code that handles
the default library loading on AIX.

Signed-off-by: Cheng Jin jincheng@ca.ibm.com

The changes aim to enable the Linker's downcall & upcall handler
to support primitives and struct by replacing DowncallLinker
& UpcallLinker with the equivalent implemented in OpenJ9.
In addition, the changes also include the code that handles
the default library loading on AIX.

Signed-off-by: Cheng Jin <jincheng@ca.ibm.com>
@ChengJin01
Copy link
Author

The Java19 specific changes (downcall & upcall) in OpenJDK belong to the issue intended for the upcall work at #15068.
Note:

  1. the PR has the same code as JDKnext at [JEP424] Implement the Linker's downcall & upcall handler in JDKnext openj9-openjdk-jdk#457 given the Java19 was created from there
  2. the PR also includes the code that ignores the alignment check for double/float to ensure it works for double related struct on AIX in Java 19 (never used in Java 17 & 18).
  3. the PR depends on the java part in PR at [Part 1/JDK19] FFI Upcall: creating the upcall stub (java part) eclipse-openj9/openj9#15307 and the native code in Design and Implementation of Foreign Linker API: Upcall eclipse-openj9/openj9#15068.

Reviewer: @tajila
FYI: @DanHeidinga, @pshipton, @gacholio

@tajila
Copy link
Member

tajila commented Jul 18, 2022

jenkins test sanity plinux jdk19

@ChengJin01
Copy link
Author

ChengJin01 commented Jul 18, 2022

The code changes here depend on the latest downcall & upcall java code in OpenJ9 at eclipse-openj9/openj9#15307 as I mentioned at eclipse-openj9/openj9#15307 (comment); otherwise, the compilation will pick up the code in OpenJDK rather than OpenJ9 and end up with failing failure on Jenkins (e.g.https://openj9-jenkins.osuosl.org/job/Build_JDK19_ppc64le_linux_Personal/7/consoleText)

2022-07-18T12:47:06.530Z] /home/jenkins/workspace/Build_JDK19_ppc64le_linux_Personal/src/java.base/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java:161: error: method getBoundMethodHandle in class DowncallLinker cannot be applied to given types;
[2022-07-18T12:47:06.530Z]         MethodHandle handle = DowncallLinker.getBoundMethodHandle(mt, cDesc);
[2022-07-18T12:47:06.530Z]                                             ^
[2022-07-18T12:47:06.530Z]   required: no arguments
[2022-07-18T12:47:06.530Z]   found:    MethodType,FunctionDescriptor
[2022-07-18T12:47:06.530Z]   reason: actual and formal argument lists differ in length

@tajila tajila merged commit 65a3b9a into ibmruntimes:openj9 Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants