How do I get my PPC64HotSpotBackendFactory registered?
Volker Simonis
volker.simonis at gmail.com
Tue Oct 29 11:57:06 PDT 2013
Hi,
if I pull the additional changes from
hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot, merge them and add some
minor changes to the Graal files I can now successfully build the
Graal VM with the C++ interpreter like so:
CC_INTERP=true ./mx.sh --java-home
/usr/work/openjdk/output-jdk7u/j2sdk-image --vm graal --vmbuild debug
build
If I run it I get the following:
./jdk1.7.0-internal/debug/bin/java -graal -XX:-BootstrapGraal
-XX:+CIPrintRequests -XX:+PrintCompilation -version
1789 1 n
java.lang.invoke.MethodHandle::linkToStatic(LL)L (native) (static)
1905 2 n
java.lang.invoke.MethodHandle::linkToStatic(LLL)L (native) (static)
request: java.lang.String::indexOf comment: count count: 470 hot: yes
2087 3 n
java.lang.invoke.MethodHandle::linkToStatic(LL)V (native) (static)
2108 4 n
java.lang.invoke.MethodHandle::linkToStatic(LL)J (native) (static)
2138 5 n
java.lang.invoke.MethodHandle::linkToStatic(LIL)V (native) (static)
2175 6 n
com.oracle.graal.hotspot.bridge.CompilerToVMImpl::executeCompiledMethodIntrinsic
(native) (static)
request: java.lang.String::hashCode comment: count count: 722 hot: yes
request: java.lang.String::indexOf comment: count count: 504 hot: yes
request: java.lang.String::charAt comment: count count: 10000 hot: yes
request: java.lang.String::hashCode comment: count count: 606 hot: yes
request: java.lang.String::indexOf comment: count count: 386 hot: yes
java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
at com.oracle.graal.hotspot.HotSpotGraalRuntime.<init>(HotSpotGraalRuntime.java:223)
at com.oracle.graal.hotspot.HotSpotGraalRuntime.<clinit>(HotSpotGraalRuntime.java:50)
which is clear because there's no PPC64 support in Graal until now.
I've then added a basic PPC64HotSpotBackendFactory/PPC64HotSpotBackend
in the same way as this is done for the other architectures and
recompiled but for some reason, still with the same result (i.e. no
HotSpotBackendFactory can be found for PPC64). I've then printed the
available factories in HotSpotGraalRuntime.findFactory (with printf
debugging) and found that the following factories are available:
----------AMD64-----------
----------PTX-----------
----------HSAIL-----------
Notice that SPARC is not listed here as well! I've then added the
following lines:
# graal.hotspot.ppc64
project at com.oracle.graal.hotspot.ppc64@subDir=graal
project at com.oracle.graal.hotspot.ppc64@sourceDirs=src
project at com.oracle.graal.hotspot.ppc64@dependencies=com.oracle.graal.hotspot,com.oracle.graal.ppc64
project at com.oracle.graal.hotspot.ppc64@checkstyle=com.oracle.graal.graph
project at com.oracle.graal.hotspot.ppc64@annotationProcessors=com.oracle.graal.service.processor
project at com.oracle.graal.hotspot.ppc64@javaCompliance=1.7
project at com.oracle.graal.hotspot.ppc64@workingSets=Graal,HotSpot,PPC64
to mx/projects and expected that the 'annotationProcessors' line will
do the job - unfortunately without any success.
I've then finally manually added the line:
com.oracle.graal.hotspot.ppc64.PPC64HotSpotBackendFactory
to the file META-INF/services/com.oracle.graal.hotspot.HotSpotBackendFactory
in graal.jar and that finally did the job! I now get the following
output when running the Graal VM:
./jdk1.7.0-internal/debug/bin/java -graal -XX:-BootstrapGraal
-XX:+CIPrintRequests -XX:+PrintCompilation -version
3720 1 n
java.lang.invoke.MethodHandle::linkToStatic(LL)L (native) (static)
3921 2 n
java.lang.invoke.MethodHandle::linkToStatic(LLL)L (native) (static)
request: java.lang.String::indexOf comment: count count: 470 hot: yes
4253 3 n
java.lang.invoke.MethodHandle::linkToStatic(LL)V (native) (static)
4287 4 n
java.lang.invoke.MethodHandle::linkToStatic(LL)J (native) (static)
4340 5 n
java.lang.invoke.MethodHandle::linkToStatic(LIL)V (native) (static)
4406 6 n
com.oracle.graal.hotspot.bridge.CompilerToVMImpl::executeCompiledMethodIntrinsic
(native) (static)
request: java.lang.String::hashCode comment: count count: 722 hot: yes
request: java.lang.String::indexOf comment: count count: 504 hot: yes
request: java.lang.String::charAt comment: count count: 10000 hot: yes
request: java.lang.String::hashCode comment: count count: 606 hot: yes
request: java.lang.String::indexOf comment: count count: 386 hot: yes
com.oracle.graal.graph.GraalInternalError: unimplemented
at com.oracle.graal.graph.GraalInternalError.unimplemented(GraalInternalError.java:38)
at com.oracle.graal.hotspot.ppc64.PPC64HotSpotCodeCacheProvider.createRegisterConfig(PPC64HotSpotCodeCacheProvider.java:38)
at com.oracle.graal.hotspot.meta.HotSpotCodeCacheProvider.<init>(HotSpotCodeCacheProvider.java:54)
at com.oracle.graal.hotspot.ppc64.PPC64HotSpotCodeCacheProvider.<init>(PPC64HotSpotCodeCacheProvider.java:33)
at com.oracle.graal.hotspot.ppc64.PPC64HotSpotBackendFactory.createBackend(PPC64HotSpotBackendFactory.java:53)
at com.oracle.graal.hotspot.HotSpotGraalRuntime.<init>(HotSpotGraalRuntime.java:224)
at com.oracle.graal.hotspot.HotSpotGraalRuntime.<clinit>(HotSpotGraalRuntime.java:50)
which is OK, because
PPC64HotSpotCodeCacheProvider.createRegisterConfig() currently throws
an GraalInternalError.
So now back to my initial question: how do I manage to get my
PPC64HotSpotBackendFactory registered automatically without the need
to manually edit the META_INF files?
Thank you and best regards,
Volker
More information about the graal-dev
mailing list