[foreign-abi] RFR: Revisit FunctionDescriptor

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Feb 3 18:10:28 UTC 2020


(without having looked at the code) - jextract runtime support is 
currently using the varargs info to generate varargs MethodHandle which 
do the specialization. As you say, we can tackle that problem with 
annotations, although I'm not sure of what's the net gain in moving 
things around. At this point I guess I'd prefer jextract to not generate 
any magic annotation - the Declaration.Function class knows whether a 
function is a varargs or not, so there's no need to truck that info into 
the runtime.

Maurizio

On 03/02/2020 16:19, Jorn Vernee wrote:
> Hi,
>
> Please review the following patch that revisits FunctionDescriptor: 1. 
> Adds appendArgumentLayouts, and changeReturnLayout combinator methods. 
> 2. Removes the variadic flag. This flag was not really being used in 
> practice, since we can not link variadic functions directly any ways. 
> Using the new appendArgumentLayouts method we can 'specialize' a base 
> FD with different argument layouts representing vararg arguments. I 
> think if a similar flag is needed in the future, we should consider 
> adding annotations to FunctionDescriptor, and making it an annotation 
> instead, but currently it doesn't seem like it's pulling it's weight 
> by being in the API.
>
> Webrev: 
> http://cr.openjdk.java.net/~jvernee/panama/webrevs/cleanup_fd/webrev.00/
> Bugs: https://bugs.openjdk.java.net/browse/JDK-8238226, 
> https://bugs.openjdk.java.net/browse/JDK-8237580
>
> Again, this patch applies on top of the Binding cleanup patch.
>
> Thanks,
> Jorn
>


More information about the panama-dev mailing list