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

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Apr 7 11:08:34 UTC 2020


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

>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix incorrect copyright header
>
> 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.

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

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


More information about the panama-dev mailing list