Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalVMToCompiler.cpp @ 12456:f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 17 Oct 2013 01:08:17 +0200 |
parents | 03fe11f5f186 |
children | 0dd597c6c9c7 |
comparison
equal
deleted
inserted
replaced
12455:d08accd58925 | 12456:f87c68d79f07 |
---|---|
51 Handle VMToCompiler::truffleRuntime() { | 51 Handle VMToCompiler::truffleRuntime() { |
52 Symbol* name = vmSymbols::com_oracle_graal_truffle_GraalTruffleRuntime(); | 52 Symbol* name = vmSymbols::com_oracle_graal_truffle_GraalTruffleRuntime(); |
53 KlassHandle klass = loadClass(name); | 53 KlassHandle klass = loadClass(name); |
54 | 54 |
55 JavaValue result(T_OBJECT); | 55 JavaValue result(T_OBJECT); |
56 JavaCalls::call_static(&result, klass, vmSymbols::makeInstance_name(), vmSymbols::getTruffleRuntimeInstance_signature(), Thread::current()); | 56 JavaCalls::call_static(&result, klass, vmSymbols::makeInstance_name(), vmSymbols::makeInstance_signature(), Thread::current()); |
57 check_pending_exception("Couldn't initialize GraalTruffleRuntime"); | 57 check_pending_exception("Couldn't initialize GraalTruffleRuntime"); |
58 return Handle((oop) result.get_jobject()); | 58 return Handle((oop) result.get_jobject()); |
59 } | 59 } |
60 | 60 |
61 Handle VMToCompiler::graalRuntime() { | 61 Handle VMToCompiler::graalRuntime() { |
62 if (JNIHandles::resolve(_graalRuntimePermObject) == NULL) { | 62 if (JNIHandles::resolve(_graalRuntimePermObject) == NULL) { |
63 #ifdef AMD64 | 63 KlassHandle klass = loadClass(vmSymbols::com_oracle_graal_hotspot_HotSpotGraalRuntime()); |
64 Symbol* name = NULL; | |
65 // Set name to PTXHotSpotRuntime if nVidia GPU was detected. | |
66 if (UseGPU && (gpu::get_target_il_type() == gpu::PTX) && | |
67 gpu::is_available() && gpu::has_gpu_linkage()) { | |
68 name = vmSymbols::com_oracle_graal_hotspot_ptx_PTXHotSpotGraalRuntime(); | |
69 } | |
70 | |
71 if (name == NULL) { | |
72 name = vmSymbols::com_oracle_graal_hotspot_amd64_AMD64HotSpotGraalRuntime(); | |
73 } | |
74 #endif | |
75 #ifdef SPARC | |
76 Symbol* name = vmSymbols::com_oracle_graal_hotspot_sparc_SPARCHotSpotGraalRuntime(); | |
77 #endif | |
78 KlassHandle klass = loadClass(name); | |
79 | |
80 JavaValue result(T_OBJECT); | 64 JavaValue result(T_OBJECT); |
81 JavaCalls::call_static(&result, klass, vmSymbols::makeInstance_name(), vmSymbols::getInstance_signature(), Thread::current()); | 65 JavaCalls::call_static(&result, klass, vmSymbols::runtime_name(), vmSymbols::runtime_signature(), Thread::current()); |
82 check_pending_exception("Couldn't initialize HotSpotGraalRuntime"); | 66 check_pending_exception("Couldn't initialize HotSpotGraalRuntime"); |
83 _graalRuntimePermObject = JNIHandles::make_global((oop) result.get_jobject()); | 67 _graalRuntimePermObject = JNIHandles::make_global((oop) result.get_jobject()); |
84 } | 68 } |
85 return Handle(JNIHandles::resolve_non_null(_graalRuntimePermObject)); | 69 return Handle(JNIHandles::resolve_non_null(_graalRuntimePermObject)); |
86 } | 70 } |