-
Enhancement
-
Resolution: Fixed
-
P2
-
repo-panama
The HotSpot JVM currently has feature for native calls that passes elements of a primitive array to a native function if it finds an entry point for that native function that is prefixed with JavaCritical_.[1]
No JDK code currently uses this feature since it is not officially supported, but it may be used in some experimental and external code to improve performance.
We would like to deprecate this feature, but recognize that this may be a useful optimization for performance of native calls. [2]
A suggested Panama replacement could be code that adds a "pin" method to MemorySegment (see comment), or some other marker, that avoids the copy to native memory then calls the function as a trivial function, like:
func_trivial = abi.downcallHandle(addr, mt, fd.withAttribute(FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME, true));
[1] https://stackoverflow.com/questions/48730135/how-to-get-javacritical-to-really-work-on-jni
[2] https://bugs.openjdk.java.net/browse/JDK-8233343
- csr for
-
JDK-8318645 Add Panama feature to pass heap segments to native code
- Closed
- relates to
-
JDK-8320131 Zero build fails on macOS after JDK-8254693
- Resolved
-
JDK-8321130 Microbenchmarks do not build any more after 8254693 on 32 bit platforms
- Resolved
-
JDK-8276094 JEP 423: Region Pinning for G1
- Closed
-
JDK-8329958 Windows x86 build fails: downcallLinker.cpp(36) redefinition
- Resolved
-
JDK-8289302 Restore CriticalJNINatives
- Closed
-
JDK-8233343 Deprecate -XX:+CriticalJNINatives flag which implements JavaCritical native functions
- Resolved