RFR: 7903660: Drop layout-inferring varargs invoker + add method handle factory [v2]
Jorn Vernee
jvernee at openjdk.org
Mon Feb 12 14:48:20 UTC 2024
> This PR removes the layout-inferring variadic invokers that we generate. Instead, users will have to create an instance of the invoker interface first, by specifying the layouts of the variadic args explicitly. This leads to a more WYSIWYG approach, where we don't have to guess what the correct variadic layouts are.
>
> Additionally, a `handle` and `descriptor` factory are added to the invoker interface, which can be used to create specialized method handles and function descriptors for the variadic function. The base descriptor and function address are also exposed as fields.
>
> Open questions:
> 1. Should we try and hide these fields (with another private nested class)? And if not, should we expose the function address for regular functions as well?
> 2. Some layouts are illegal as variadic layouts (e.g. C_FLOAT). The `descriptor` factory currently doesn't reject these. Are we happy with that? On the other hand. Making this factory reject those layouts would be quite some work, and would need to be kept in sync with the linker implementation. This didn't seem worth it, so I've left this.
>
> Finally, I've removed the now unused runtime helper code related to inferring variadic layouts.
Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
record-based approach
-------------
Changes:
- all: https://git.openjdk.org/jextract/pull/205/files
- new: https://git.openjdk.org/jextract/pull/205/files/ea146b4c..477b254f
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jextract&pr=205&range=01
- incr: https://webrevs.openjdk.org/?repo=jextract&pr=205&range=00-01
Stats: 56 lines in 3 files changed: 11 ins; 32 del; 13 mod
Patch: https://git.openjdk.org/jextract/pull/205.diff
Fetch: git fetch https://git.openjdk.org/jextract.git pull/205/head:pull/205
PR: https://git.openjdk.org/jextract/pull/205
More information about the jextract-dev
mailing list