How do I get my PPC64HotSpotBackendFactory registered?

Doug Simon doug.simon at oracle.com
Tue Oct 29 13:12:27 PDT 2013


One extra thing you have to do after editing mx/projects is to clean the Java classes and rebuild them:

% mx clean --no-native
% mx build

This is because currently, the simple out-of-date check used for a project's Java sources is only to look at the corresponding class files. I'll look into beefing up this check such that a change in a project's configuration makes the sources (conservatively) out-of-date.

-Doug

On Oct 29, 2013, at 8:50 PM, "D.Sturm" <D.Sturm42 at gmail.com> wrote:

> I looked into that myself for the Aarch64 port, so I can give some insight:
> 
> Basically it's not enough to just specify the annotationProcessor for your
> project. You also have to add the folder that contains your project to the
> "distribution at GRAAL@dependencies=\" list in the projects file. There are
> already several entries for amd64, etc. there. One important thing to
> consider: You have to list the *folder* and not the package name there
> (basically give it the path relative from graal/ to the directory
> containing the bin folder). mx will then automatically generate the correct
> META-INF entries for the annotationProcessors you specify.
> 
> regards,
> Daniel.
> 
> On 29 October 2013 19:57, Volker Simonis <volker.simonis at gmail.com> wrote:
> 
>> 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