[foreign-jextract] [Rev 01] RFR: 8239493: Add classfile generation to jextract

Jorn Vernee jvernee at openjdk.java.net
Tue Apr 7 13:01:12 UTC 2020


On Tue, 7 Apr 2020 10:40:18 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/jdk.incubator.jextract/share/classes/jdk/incubator/jextract/tool/JavaSourceBuilder.java line 129:
>> 
>>> 128:     private String getFunction(String javaName, FunctionDescriptor fDesc) {
>>> 129:         return getterCall(constantHelper.addFunctionDesc(javaName, fDesc));
>>> 130:     }
>> 
>> I like the "flowy" nature of the new source builder ��
>
> Generally great, one very minor nit is that I find the distinction between the `addMethodHandle` and `getMethodHandle`
> confusing. If you look in the method bodies, the distinction is not made much clearer, since one calls
> `emitForwarderGetter` and the other `getterCall`, which look on the surface pretty similar.  I think that, ideally, the
> naming should reflect more the fact that one is adding a new member declaration to the bindings, while the other is
> just retrieving a constant - no members added.

I've renamed these to `addMethodHandleGetter` and `methodHandleGetCallString` for more clarity, as well as moving the
latter to the end of the file to avoid confusion.

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

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


More information about the panama-dev mailing list