RFR: 7903597: Slim down RuntimeHelper [v3]
Maurizio Cimadamore
mcimadamore at openjdk.org
Mon Dec 4 14:43:14 UTC 2023
On Mon, 4 Dec 2023 14:36:32 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Remove some of the helper methods in RuntimeHelper. They can be moved inline in the generated code.
>>
>> Also: I've elected to move the `System.load(Library)` directives we generated inside RuntimeHelper into the first header class, in order to have it more localized to the actual code that a user sees. That also makes RuntimeHelper more 'dumb'. Only the package declaration is now injected into the template, which makes it easier for users to combined multiple extraction runs (they can just discard one of the generated RuntimeHelpers).
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>
> drop unused method
Looks very good, I think dropping RuntimeHelper will help developers better understanding what comes out of an extraction run
src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java line 64:
> 62:
> 63: ClassSourceBuilder(SourceFileBuilder builder, String modifiers, Kind kind, String className, String superName,
> 64: ClassSourceBuilder enclosing, String runtimeHelperName) {
nit: maybe we want to call this "mainHeaderClass" or something like that?
-------------
Marked as reviewed by mcimadamore (Committer).
PR Review: https://git.openjdk.org/jextract/pull/150#pullrequestreview-1762566569
PR Review Comment: https://git.openjdk.org/jextract/pull/150#discussion_r1413969405
More information about the jextract-dev
mailing list