RFR: 8238226: Revisit FunctionDescriptor
Jorn Vernee
jvernee at openjdk.java.net
Tue Feb 11 13:03:14 UTC 2020
On Tue, 11 Feb 2020 12:50:46 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> Continuation of: https://mail.openjdk.java.net/pipermail/panama-dev/2020-February/007418.html
>
>> 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
Here I've uploaded the first revision that removes the variadic information from FunctionDescriptor, according to the last message on the old mail thread:
> ...
> Let's just remove variadic-ness info for now. As I said, jextract is fully able to recover that info from the jextract declaration API. Before, we needed that info _in the layouts/descriptors_ because they were the only thing that came out of jextract - and they were what drove the binder. Now the story is more nuanced and jextract will be able to generate the right MH w/o needed any special hook in function descriptor.
>
> Maurizio
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/15
More information about the panama-dev
mailing list