Problem loading Truffle service providers in Graal

Doug Simon doug.simon at
Sun Feb 26 11:20:58 UTC 2017

While trying to get upstream Graal working again with JDK 9, I'm having problems with service loading. Graal uses a LayoutFactory service defined by Truffle where the latter also includes a provider. The relevant parts of the module-info descriptors are:

module {


    provides with;


module jdk.internal.vm.compiler {
    requires transitive;


However, looking up a provider in Graal[1] returns no providers. As far as I understand service loading with modules, this is  because jdk.internal.vm.compiler is loaded via the platform class loader while truffle is loaded via the app class loader as shown by the output of trace statements I added:

GraalTruffleRuntime.class.getClassLoader() -> jdk.internal.loader.ClassLoaders$PlatformClassLoader at 366e2eef
LayoutFactory.class.getClassLoader() -> jdk.internal.loader.ClassLoaders$AppClassLoader at 6df97b55

This ability of a platform loaded class to depend on an app loaded class is probably due to the soon-to-be-disabled mechanism[2] we use for overriding the version of Graal bundled with JDK 9.

Is there some command line magic I can use to make this case work now or do I have to wait until [2] is addressed? If the latter, how will it work then?



More information about the graal-dev mailing list