[foreign-memaccess+abi] RFR: 8274912: Eagerly generate native invokers [v2]
Jorn Vernee
jvernee at openjdk.java.net
Mon Oct 11 09:58:58 UTC 2021
> Hi,
>
> This patch is a refactoring of VM code pertaining to downcalls. As outlined in the JBS issue, this patch makes 'native invoker' generation currently done by C2 eager.
>
> Most of the changes in this patch are moving around existing code:
> - The native invoker generation code is moved from sharedRuntime*.cpp to universalNativeInvoker*.cpp, to match what is done for upcalls.
> - C2 & nmethod scaffolding for registering native invokers has been removed (lifetime is now managed in Java code).
> - Now, C2 will only intrinsify trivial downcalls, which means some of the code was simplified there.
> - To reduce code duplication, several utilities have been added:
> - ArgumentShuffle (and impls of CallConvClosure): a utility class for computing argument shuffles and generating shuffling code. The shuffling code is heavily based on what is done today for optimized upcalls on x64.
> - To support the above, I've made a copy of the ComputeMoveOrder utility from SharedRuntime code (which was only implemented on x64), and adapted it to our use case.
> - RegSpillFill: similarly, a utility for computing and generating register spill and fill code (given a list of registers).
> - oop_cast: this was a pre-existing utility that was renamed (from 'cast') and moved into a separate file.
> - The linkToNative method handle stub now just loads the invoker address from the appendix argument and jumps to it, instead of jumping to the fallback method handle.
>
> The implementation passes all the jdk_foreign tests on Windows/x64, Linux/x64 (WSL), and Linux/AArch64. Though, there were some pre-exsiting test failures on AArch64 wrt variadic functions.
>
> Thanks,
> Jorn
Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
AArch64 comments
-------------
Changes:
- all: https://git.openjdk.java.net/panama-foreign/pull/593/files
- new: https://git.openjdk.java.net/panama-foreign/pull/593/files/493165e4..febe2ffc
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=593&range=01
- incr: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=593&range=00-01
Stats: 43 lines in 3 files changed: 0 ins; 0 del; 43 mod
Patch: https://git.openjdk.java.net/panama-foreign/pull/593.diff
Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/593/head:pull/593
PR: https://git.openjdk.java.net/panama-foreign/pull/593
More information about the panama-dev
mailing list