[foreign-jextract] RFR: 8261642: improve jextract source generation mode and remove class generation [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Feb 15 14:12:51 UTC 2021


On Mon, 15 Feb 2021 12:35:45 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove template for @C annotation
>>   Remove debugging/parameter info from jextract compilation
>
> src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/ConstantBuilder.java line 318:
> 
>> 316:                 append(delim);
>> 317:                 indent();
>> 318:                 emitLayoutString(e);
> 
> Looks like this is emitting all layouts inline? I guess there's not much that can be easily done about that in the current code (or maybe you have an idea). Maybe in the future a scheme where the return/params are references to other constants could reduce overhead further. (e.g. it seems common that if a func desc references a struct layout, then we also have a struct class that already declares that layout).

Yes - this duplicates code for layout creation. We can improve this further - e.g. by referring to the struct/functional interface layout, but I'd prefer if we moved that to a separate issue. Also I've played with things like e.g. sharing function descriptors with same shape and didn't really observed any significant gain in footprint.

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

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


More information about the panama-dev mailing list