[foreign-jextract] RFR: 8252016: jextract should handle va_list [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Aug 19 11:14:45 UTC 2020


On Wed, 19 Aug 2020 07:56:53 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> adding va_list support for jextract
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last
> revision:
>   Removed unused import. Removed unwanted comment character.

Looks good, except for some chanegs in RuntimeHelper which are not very clear to me

src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/resources/RuntimeHelper.java.template line 88:

> 87:                     return variadic || isVaList(fdesc)?
> 88:                         VarargsInvoker.make(addr, mt, fdesc) :
> 89:                         ABI.downcallHandle(addr, mt, fdesc);

I don't get this change - we don't want a vararg invoker for a valist call, right? The invoker will most surely not do
the right thing here.

Also, the test seems to show that no Java varargs invocation is being applied (which is correct), so what is the
reasons for the changes in RuntimeHelper?

src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/OutputFactory.java line 225:

> 224:
> 225:     private static final boolean isVaList(FunctionDescriptor desc) {
> 226:         List<MemoryLayout> argLayouts = desc.argumentLayouts();

Ugh - too bad there's no way to detect this in libclang - not your fault of course!

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/285


More information about the panama-dev mailing list