Provides clauses in binary module descriptor but not in source

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Provides clauses in binary module descriptor but not in source

Doug Simon
I just noticed that in the jdk.internal.vm.compiler module descriptor source there is a `uses` clause for CompilerConfigurationFactory[1] but no `provides` clause for the CoreCompilerConfigurationFactory provider[2] which is in the same module. However, `java -d jdk.internal.vm.compiler | grep Core` shows me the provider clause exists in the binary module descriptor. Is this done auto-magically by javac when building the module? If not, is it in the make files somewhere? I'm asking because there are new service providers being added in Graal.

-Doug

[1] http://hg.openjdk.java.net/jdk/jdk/file/2918e1146106/src/jdk.internal.vm.compiler/share/classes/module-info.java#l36
[2] http://hg.openjdk.java.net/jdk/jdk/file/2918e1146106/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java#l30

Reply | Threaded
Open this post in threaded view
|

Re: Provides clauses in binary module descriptor but not in source

Alan Bateman
On 13/04/2018 13:16, Doug Simon wrote:
> I just noticed that in the jdk.internal.vm.compiler module descriptor source there is a `uses` clause for CompilerConfigurationFactory[1] but no `provides` clause for the CoreCompilerConfigurationFactory provider[2] which is in the same module. However, `java -d jdk.internal.vm.compiler | grep Core` shows me the provider clause exists in the binary module descriptor. Is this done auto-magically by javac when building the module? If not, is it in the make files somewhere? I'm asking because there are new service providers being added in Graal.
>
The build for that module is complex as it runs an annotation processor
and generates a module-info.java.extra (see
support/gensrc/jdk.internal.vm.compiler/ in the build output) that is
merged with the module-info.java before it is compiled. So no javac magic.

-Alan
Reply | Threaded
Open this post in threaded view
|

Re: Provides clauses in binary module descriptor but not in source

Doug Simon


> On 13 Apr 2018, at 14:33, Alan Bateman <[hidden email]> wrote:
>
> On 13/04/2018 13:16, Doug Simon wrote:
>> I just noticed that in the jdk.internal.vm.compiler module descriptor source there is a `uses` clause for CompilerConfigurationFactory[1] but no `provides` clause for the CoreCompilerConfigurationFactory provider[2] which is in the same module. However, `java -d jdk.internal.vm.compiler | grep Core` shows me the provider clause exists in the binary module descriptor. Is this done auto-magically by javac when building the module? If not, is it in the make files somewhere? I'm asking because there are new service providers being added in Graal.
>>
> The build for that module is complex as it runs an annotation processor and generates a module-info.java.extra (see support/gensrc/jdk.internal.vm.compiler/ in the build output) that is merged with the module-info.java before it is compiled. So no javac magic.

Ah yes, I'd forgotten that the @ServiceProvider annotation was run my the JDK make system. Thanks for the helpful reminder; it means we can simply use this annotation for the new service providers we're adding and everything should Just Work.

-Doug