Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalVMExits.cpp @ 3011:f00918f35c7f
inlining and runtime interface related changes:
added codeSize() and compilerStorage() to RiMethod
HotSpotMethodResolved uses reflective methods instead of vmIds and survives compilations
HotSpotResolvedType.isInitialized not represented as field (can change)
inlining stores graphs into method objects and reuses them
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 16 Jun 2011 20:36:17 +0200 |
parents | 0c0e407faa39 |
children | 5e9645341ec3 |
comparison
equal
deleted
inserted
replaced
2993:3671e31615c9 | 3011:f00918f35c7f |
---|---|
23 | 23 |
24 #include "precompiled.hpp" | 24 #include "precompiled.hpp" |
25 #include "graal/graalVMExits.hpp" | 25 #include "graal/graalVMExits.hpp" |
26 | 26 |
27 // this is a *global* handle | 27 // this is a *global* handle |
28 jobject VMExits::_compilerPermObject; | 28 jobject VMExits::_compilerPermObject = NULL; |
29 jobject VMExits::_vmExitsPermObject; | 29 jobject VMExits::_vmExitsPermObject = NULL; |
30 jobject VMExits::_vmExitsPermKlass; | 30 jobject VMExits::_vmExitsPermKlass = NULL; |
31 | 31 |
32 KlassHandle VMExits::vmExitsKlass() { | 32 KlassHandle VMExits::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_sun_hotspot_graal_VMExits(), SystemDictionary::java_system_loader(), NULL, Thread::current()); |
35 check_not_null(result, "Couldn't find class com.sun.hotspot.graal.VMExits"); | 35 check_not_null(result, "Couldn't find class com.sun.hotspot.graal.VMExits"); |
97 JavaValue result(T_VOID); | 97 JavaValue result(T_VOID); |
98 JavaCalls::call_static(&result, compilerKlass, vmSymbols::setDefaultOptions_name(), vmSymbols::void_method_signature(), THREAD); | 98 JavaCalls::call_static(&result, compilerKlass, vmSymbols::setDefaultOptions_name(), vmSymbols::void_method_signature(), THREAD); |
99 check_pending_exception("Error while calling setDefaultOptions"); | 99 check_pending_exception("Error while calling setDefaultOptions"); |
100 } | 100 } |
101 | 101 |
102 void VMExits::compileMethod(jlong methodVmId, Handle name, int entry_bci) { | 102 void VMExits::compileMethod(Handle hotspot_method, int entry_bci) { |
103 assert(!name.is_null(), "just checking"); | 103 assert(!hotspot_method.is_null(), "just checking"); |
104 Thread* THREAD = Thread::current(); | 104 Thread* THREAD = Thread::current(); |
105 JavaValue result(T_VOID); | 105 JavaValue result(T_VOID); |
106 JavaCallArguments args; | 106 JavaCallArguments args; |
107 args.push_oop(instance()); | 107 args.push_oop(instance()); |
108 args.push_long(methodVmId); | 108 args.push_oop(hotspot_method); |
109 args.push_oop(name); | |
110 args.push_int(entry_bci); | 109 args.push_int(entry_bci); |
111 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, THREAD); | 110 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, THREAD); |
112 check_pending_exception("Error while calling compileMethod"); | 111 check_pending_exception("Error while calling compileMethod"); |
113 } | 112 } |
114 | 113 |
115 void VMExits::shutdownCompiler() { | 114 void VMExits::shutdownCompiler() { |
116 HandleMark hm; | 115 if (_compilerPermObject != NULL) { |
117 JavaThread* THREAD = JavaThread::current(); | 116 HandleMark hm; |
118 JavaValue result(T_VOID); | 117 JavaThread* THREAD = JavaThread::current(); |
119 JavaCallArguments args; | 118 JavaValue result(T_VOID); |
120 args.push_oop(instance()); | 119 JavaCallArguments args; |
121 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::shutdownCompiler_name(), vmSymbols::void_method_signature(), &args, THREAD); | 120 args.push_oop(instance()); |
122 check_pending_exception("Error while calling shutdownCompiler"); | 121 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::shutdownCompiler_name(), vmSymbols::void_method_signature(), &args, THREAD); |
122 check_pending_exception("Error while calling shutdownCompiler"); | |
123 | |
124 JNIHandles::destroy_global(_compilerPermObject); | |
125 JNIHandles::destroy_global(_vmExitsPermObject); | |
126 JNIHandles::destroy_global(_vmExitsPermKlass); | |
127 | |
128 _compilerPermObject = NULL; | |
129 _vmExitsPermObject = NULL; | |
130 _vmExitsPermKlass = NULL; | |
131 } | |
123 } | 132 } |
124 | 133 |
125 void VMExits::startCompiler() { | 134 void VMExits::startCompiler() { |
126 JavaThread* THREAD = JavaThread::current(); | 135 JavaThread* THREAD = JavaThread::current(); |
127 JavaValue result(T_VOID); | 136 JavaValue result(T_VOID); |