Mercurial > hg > truffle
comparison src/share/vm/graal/graalVMToCompiler.cpp @ 4223:e0a4668c57a2
Renaming of VMExits and VMEntries part 4.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 04 Jan 2012 22:08:17 +0100 |
parents | 5c80ccb80036 |
children | bf63d72879aa |
comparison
equal
deleted
inserted
replaced
4222:8e2985cdaaa5 | 4223:e0a4668c57a2 |
---|---|
29 jobject VMToCompiler::_vmExitsPermObject = NULL; | 29 jobject VMToCompiler::_vmExitsPermObject = NULL; |
30 jobject VMToCompiler::_vmExitsPermKlass = NULL; | 30 jobject VMToCompiler::_vmExitsPermKlass = NULL; |
31 | 31 |
32 KlassHandle VMToCompiler::vmExitsKlass() { | 32 KlassHandle VMToCompiler::vmExitsKlass() { |
33 if (JNIHandles::resolve(_vmExitsPermKlass) == NULL) { | 33 if (JNIHandles::resolve(_vmExitsPermKlass) == NULL) { |
34 klassOop result = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_VMExits(), SystemDictionary::java_system_loader(), NULL, Thread::current()); | 34 klassOop result = SystemDictionary::resolve_or_null(vmSymbols::com_oracle_max_graal_hotspot_bridge_VMToCompiler(), SystemDictionary::java_system_loader(), NULL, Thread::current()); |
35 check_not_null(result, "Couldn't find class com.oracle.max.graal.hotspot.bridge.VMToCompiler"); | 35 check_not_null(result, "Couldn't find class com.oracle.max.graal.hotspot.bridge.VMToCompiler"); |
36 _vmExitsPermKlass = JNIHandles::make_global(result); | 36 _vmExitsPermKlass = JNIHandles::make_global(result); |
37 } | 37 } |
38 return KlassHandle((klassOop)JNIHandles::resolve_non_null(_vmExitsPermKlass)); | 38 return KlassHandle((klassOop)JNIHandles::resolve_non_null(_vmExitsPermKlass)); |
39 } | 39 } |
40 | 40 |
41 Handle VMToCompiler::compilerInstance() { | 41 Handle VMToCompiler::compilerInstance() { |
42 if (JNIHandles::resolve(_compilerPermObject) == NULL) { | 42 if (JNIHandles::resolve(_compilerPermObject) == NULL) { |
43 KlassHandle compilerImplKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_CompilerImpl(), SystemDictionary::java_system_loader(), NULL, Thread::current()); | 43 KlassHandle compilerImplKlass = SystemDictionary::resolve_or_null(vmSymbols::com_oracle_max_graal_hotspot_CompilerImpl(), SystemDictionary::java_system_loader(), NULL, Thread::current()); |
44 check_not_null(compilerImplKlass(), "Couldn't find class com.sun.hotspot.graal.CompilerImpl"); | 44 check_not_null(compilerImplKlass(), "Couldn't find class com.sun.hotspot.graal.CompilerImpl"); |
45 | 45 |
46 JavaValue result(T_OBJECT); | 46 JavaValue result(T_OBJECT); |
47 JavaCalls::call_static(&result, compilerImplKlass, vmSymbols::getInstance_name(), vmSymbols::getInstance_signature(), Thread::current()); | 47 JavaCalls::call_static(&result, compilerImplKlass, vmSymbols::getInstance_name(), vmSymbols::getInstance_signature(), Thread::current()); |
48 check_pending_exception("Couldn't get Compiler"); | 48 check_pending_exception("Couldn't get Compiler"); |
51 return Handle(JNIHandles::resolve_non_null(_compilerPermObject)); | 51 return Handle(JNIHandles::resolve_non_null(_compilerPermObject)); |
52 } | 52 } |
53 | 53 |
54 Handle VMToCompiler::instance() { | 54 Handle VMToCompiler::instance() { |
55 if (JNIHandles::resolve(_vmExitsPermObject) == NULL) { | 55 if (JNIHandles::resolve(_vmExitsPermObject) == NULL) { |
56 KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_Compiler(), SystemDictionary::java_system_loader(), NULL, Thread::current()); | 56 KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_oracle_max_graal_hotspot_Compiler(), SystemDictionary::java_system_loader(), NULL, Thread::current()); |
57 check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.Compiler"); | 57 check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.Compiler"); |
58 | 58 |
59 JavaValue result(T_OBJECT); | 59 JavaValue result(T_OBJECT); |
60 JavaCallArguments args; | 60 JavaCallArguments args; |
61 args.set_receiver(compilerInstance()); | 61 args.set_receiver(compilerInstance()); |
65 } | 65 } |
66 return Handle(JNIHandles::resolve_non_null(_vmExitsPermObject)); | 66 return Handle(JNIHandles::resolve_non_null(_vmExitsPermObject)); |
67 } | 67 } |
68 | 68 |
69 void VMToCompiler::initializeCompiler() { | 69 void VMToCompiler::initializeCompiler() { |
70 KlassHandle compilerImplKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_CompilerImpl(), SystemDictionary::java_system_loader(), NULL, Thread::current()); | 70 KlassHandle compilerImplKlass = SystemDictionary::resolve_or_null(vmSymbols::com_oracle_max_graal_hotspot_CompilerImpl(), SystemDictionary::java_system_loader(), NULL, Thread::current()); |
71 check_not_null(compilerImplKlass(), "Couldn't find class com.sun.hotspot.graal.CompilerImpl"); | 71 check_not_null(compilerImplKlass(), "Couldn't find class com.sun.hotspot.graal.CompilerImpl"); |
72 | 72 |
73 JavaValue result(T_VOID); | 73 JavaValue result(T_VOID); |
74 JavaCalls::call_static(&result, compilerImplKlass, vmSymbols::initialize_name(), vmSymbols::void_method_signature(), Thread::current()); | 74 JavaCalls::call_static(&result, compilerImplKlass, vmSymbols::initialize_name(), vmSymbols::void_method_signature(), Thread::current()); |
75 check_pending_exception("Couldn't initialize compiler"); | 75 check_pending_exception("Couldn't initialize compiler"); |
76 } | 76 } |
77 | 77 |
78 jboolean VMToCompiler::setOption(Handle option) { | 78 jboolean VMToCompiler::setOption(Handle option) { |
79 assert(!option.is_null(), ""); | 79 assert(!option.is_null(), ""); |
80 KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_HotSpotOptions(), SystemDictionary::java_system_loader(), NULL, Thread::current()); | 80 KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_oracle_max_graal_hotspot_HotSpotOptions(), SystemDictionary::java_system_loader(), NULL, Thread::current()); |
81 check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.HotSpotOptions"); | 81 check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.HotSpotOptions"); |
82 | 82 |
83 Thread* THREAD = Thread::current(); | 83 Thread* THREAD = Thread::current(); |
84 JavaValue result(T_BOOLEAN); | 84 JavaValue result(T_BOOLEAN); |
85 JavaCalls::call_static(&result, compilerKlass, vmSymbols::setOption_name(), vmSymbols::setOption_signature(), option, THREAD); | 85 JavaCalls::call_static(&result, compilerKlass, vmSymbols::setOption_name(), vmSymbols::setOption_signature(), option, THREAD); |
86 check_pending_exception("Error while calling setOption"); | 86 check_pending_exception("Error while calling setOption"); |
87 return result.get_jboolean(); | 87 return result.get_jboolean(); |
88 } | 88 } |
89 | 89 |
90 void VMToCompiler::setDefaultOptions() { | 90 void VMToCompiler::setDefaultOptions() { |
91 KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_HotSpotOptions(), SystemDictionary::java_system_loader(), NULL, Thread::current()); | 91 KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_oracle_max_graal_hotspot_HotSpotOptions(), SystemDictionary::java_system_loader(), NULL, Thread::current()); |
92 check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.HotSpotOptions"); | 92 check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.HotSpotOptions"); |
93 | 93 |
94 Thread* THREAD = Thread::current(); | 94 Thread* THREAD = Thread::current(); |
95 JavaValue result(T_VOID); | 95 JavaValue result(T_VOID); |
96 JavaCalls::call_static(&result, compilerKlass, vmSymbols::setDefaultOptions_name(), vmSymbols::void_method_signature(), THREAD); | 96 JavaCalls::call_static(&result, compilerKlass, vmSymbols::setDefaultOptions_name(), vmSymbols::void_method_signature(), THREAD); |
269 } | 269 } |
270 | 270 |
271 oop VMToCompiler::createCiConstantObject(Handle object, TRAPS) { | 271 oop VMToCompiler::createCiConstantObject(Handle object, TRAPS) { |
272 JavaValue result(T_OBJECT); | 272 JavaValue result(T_OBJECT); |
273 JavaCallArguments args; | 273 JavaCallArguments args; |
274 KlassHandle klass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_cri_ci_CiConstant(), SystemDictionary::java_system_loader(), NULL, Thread::current()); | 274 KlassHandle klass = SystemDictionary::resolve_or_null(vmSymbols::com_oracle_max_cri_ci_CiConstant(), SystemDictionary::java_system_loader(), NULL, Thread::current()); |
275 JavaCalls::call_static(&result, klass(), vmSymbols::forObject_name(), vmSymbols::createCiConstantObject_signature(), object, THREAD); | 275 JavaCalls::call_static(&result, klass(), vmSymbols::forObject_name(), vmSymbols::createCiConstantObject_signature(), object, THREAD); |
276 check_pending_exception("Error while calling CiConstant.forObject"); | 276 check_pending_exception("Error while calling CiConstant.forObject"); |
277 return (oop) result.get_jobject(); | 277 return (oop) result.get_jobject(); |
278 } | 278 } |
279 | 279 |