Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCompilerToVM.cpp @ 13819:49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 30 Jan 2014 00:52:33 +0100 |
parents | 8cd953e97e2d |
children | ed3a1471e133 |
comparison
equal
deleted
inserted
replaced
13818:d2f520f46180 | 13819:49db2c1e3bee |
---|---|
38 #include "graal/graalCodeInstaller.hpp" | 38 #include "graal/graalCodeInstaller.hpp" |
39 #include "graal/graalVMToCompiler.hpp" | 39 #include "graal/graalVMToCompiler.hpp" |
40 #include "gc_implementation/g1/heapRegion.hpp" | 40 #include "gc_implementation/g1/heapRegion.hpp" |
41 #include "runtime/javaCalls.hpp" | 41 #include "runtime/javaCalls.hpp" |
42 #include "runtime/vmStructs.hpp" | 42 #include "runtime/vmStructs.hpp" |
43 #include "runtime/gpu.hpp" | |
43 | 44 |
44 | 45 |
45 Method* getMethodFromHotSpotMethod(oop hotspot_method) { | 46 Method* getMethodFromHotSpotMethod(oop hotspot_method) { |
46 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethod::klass()), "sanity"); | 47 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethod::klass()), "sanity"); |
47 return asMethod(HotSpotResolvedJavaMethod::metaspaceMethod(hotspot_method)); | 48 return asMethod(HotSpotResolvedJavaMethod::metaspaceMethod(hotspot_method)); |
817 | 818 |
818 C2V_VMENTRY(jlongArray, collectCounters, (JNIEnv *env, jobject)) | 819 C2V_VMENTRY(jlongArray, collectCounters, (JNIEnv *env, jobject)) |
819 typeArrayOop arrayOop = oopFactory::new_longArray(GraalCounterSize, CHECK_NULL); | 820 typeArrayOop arrayOop = oopFactory::new_longArray(GraalCounterSize, CHECK_NULL); |
820 JavaThread::collect_counters(arrayOop); | 821 JavaThread::collect_counters(arrayOop); |
821 return (jlongArray) JNIHandles::make_local(arrayOop); | 822 return (jlongArray) JNIHandles::make_local(arrayOop); |
823 C2V_END | |
824 | |
825 C2V_ENTRY(jobject, getGPUs, (JNIEnv *env, jobject)) | |
826 #if defined(TARGET_OS_FAMILY_bsd) || defined(TARGET_OS_FAMILY_linux) || defined(TARGET_OS_FAMILY_windows) | |
827 return gpu::probe_gpus(env); | |
828 #else | |
829 return env->NewStringUTF(""); | |
830 #endif | |
822 C2V_END | 831 C2V_END |
823 | 832 |
824 C2V_VMENTRY(int, allocateCompileId, (JNIEnv *env, jobject, jobject hotspot_method, int entry_bci)) | 833 C2V_VMENTRY(int, allocateCompileId, (JNIEnv *env, jobject, jobject hotspot_method, int entry_bci)) |
825 HandleMark hm; | 834 HandleMark hm; |
826 ResourceMark rm; | 835 ResourceMark rm; |
895 {CC"reprofile", CC"("METASPACE_METHOD")V", FN_PTR(reprofile)}, | 904 {CC"reprofile", CC"("METASPACE_METHOD")V", FN_PTR(reprofile)}, |
896 {CC"invalidateInstalledCode", CC"("HS_INSTALLED_CODE")V", FN_PTR(invalidateInstalledCode)}, | 905 {CC"invalidateInstalledCode", CC"("HS_INSTALLED_CODE")V", FN_PTR(invalidateInstalledCode)}, |
897 {CC"readUnsafeUncompressedPointer", CC"("OBJECT"J)"OBJECT, FN_PTR(readUnsafeUncompressedPointer)}, | 906 {CC"readUnsafeUncompressedPointer", CC"("OBJECT"J)"OBJECT, FN_PTR(readUnsafeUncompressedPointer)}, |
898 {CC"readUnsafeKlassPointer", CC"("OBJECT")J", FN_PTR(readUnsafeKlassPointer)}, | 907 {CC"readUnsafeKlassPointer", CC"("OBJECT")J", FN_PTR(readUnsafeKlassPointer)}, |
899 {CC"collectCounters", CC"()[J", FN_PTR(collectCounters)}, | 908 {CC"collectCounters", CC"()[J", FN_PTR(collectCounters)}, |
909 {CC"getGPUs", CC"()"STRING, FN_PTR(getGPUs)}, | |
900 {CC"allocateCompileId", CC"("HS_RESOLVED_METHOD"I)I", FN_PTR(allocateCompileId)}, | 910 {CC"allocateCompileId", CC"("HS_RESOLVED_METHOD"I)I", FN_PTR(allocateCompileId)}, |
901 {CC"isMature", CC"("METASPACE_METHOD_DATA")Z", FN_PTR(isMature)}, | 911 {CC"isMature", CC"("METASPACE_METHOD_DATA")Z", FN_PTR(isMature)}, |
902 }; | 912 }; |
903 | 913 |
904 int CompilerToVM_methods_count() { | 914 int CompilerToVM_methods_count() { |