RFR: 7903585: Revisit variadic support [v2]
Jorn Vernee
jvernee at openjdk.org
Fri Dec 1 14:34:08 UTC 2023
On Fri, 1 Dec 2023 14:00:41 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>>
>> simplify variadic layout inference
>
> src/main/resources/org/openjdk/jextract/impl/resources/RuntimeHelper.java.template line 113:
>
>> 111: // Internals only below this point
>> 112:
>> 113: private static Class<?> unboxIfNeeded(Class<?> clazz) {
>
> question - wouldn't it be simpler to have a single switch from carrier type to variadic layout directly? I think the current code organization is the way it is because we used to need both carriers and function descriptor, but now we only need the latter.
Thanks for the tip. I've managed to simplify this code quite a bit: https://github.com/openjdk/jextract/pull/149/commits/a8c387c89a4ea00dabbbc50479994c5e6b4714a4
- We only care about wrapper types, not primitves, since all the arguments come to us in an `Object[]`.
- Smaller-than-int types should be promoted to `int`, not `long`.
- No need to handle `void` (in fact, that would be wrong).
-------------
PR Review Comment: https://git.openjdk.org/jextract/pull/149#discussion_r1412168431
More information about the jextract-dev
mailing list