RFR: 7903933: Move sharable items from different generations to a common file [v4]

Nizar Benalla nbenalla at openjdk.org
Thu Mar 27 16:40:27 UTC 2025


On Thu, 27 Mar 2025 05:55:08 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:

>> Please review this patch to move the `C_*` layouts and the static utility methods into separate classes: `LayoutUtils.java` and `FFMUtils.java`, respectively.
>> 
>> - The names could later be personalized through a JSON configuration.
>> - We can use static imports if the `-t` option is no used and the files are generated into the default package, in that case we use the classname to call the static methods or use the `C_*` constants.
>> 
>> Some tests had to be modified slightly, either by adding new static imports or replacing classnames.
>
> Nizar Benalla has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
> 
>  - Merge branch 'master' into shareable-items
>  - add new option to create a sharable utility class
>    
>    cleanup: longer cmd option `framework` should use -- rather than -
>    
>    small other cleanups
>  - Merge branch 'master' into shareable-items
>  - Revert all changes - starting over from scratch
>  - replace hardcoded strings I missed
>  - move sharable items to a common class

> (4) findOrThrow
> (4) seems to be superseded by a similar method that was added in Java 23:
https://docs.oracle.com/en/java/javase/23/docs//api/java.base/java/lang/foreign/SymbolLookup.html#findOrThrow(java.lang.String)

I meant to remove this when targeting jdk 23, it seems I left it by mistake. I will remove it to reduce the number of shared items we're dealing with.

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

PR Comment: https://git.openjdk.org/jextract/pull/278#issuecomment-2758689477


More information about the jextract-dev mailing list