Mercurial > hg > truffle
comparison src/share/vm/graal/graalCompilerToVM.cpp @ 4443:6fb167f79df6
fixed methodDataOop access
author | Christian Haeubl <christian.haeubl@oracle.com> |
---|---|
date | Mon, 23 Jan 2012 15:02:58 -0800 |
parents | dc6f6e2f1a00 |
children | 7d9469b37f1f |
comparison
equal
deleted
inserted
replaced
4442:dc6f6e2f1a00 | 4443:6fb167f79df6 |
---|---|
180 JNIEXPORT jint JNICALL Java_com_oracle_max_graal_hotspot_bridge_CompilerToVMImpl_RiMethod_1invocationCount(JNIEnv *, jobject, jobject hotspot_method) { | 180 JNIEXPORT jint JNICALL Java_com_oracle_max_graal_hotspot_bridge_CompilerToVMImpl_RiMethod_1invocationCount(JNIEnv *, jobject, jobject hotspot_method) { |
181 TRACE_graal_3("CompilerToVM::RiMethod_invocationCount"); | 181 TRACE_graal_3("CompilerToVM::RiMethod_invocationCount"); |
182 return getMethodFromHotSpotMethod(hotspot_method)->invocation_count(); | 182 return getMethodFromHotSpotMethod(hotspot_method)->invocation_count(); |
183 } | 183 } |
184 | 184 |
185 // public native HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method); | |
185 JNIEXPORT jobject JNICALL Java_com_oracle_max_graal_hotspot_bridge_CompilerToVMImpl_RiMethod_1methodData(JNIEnv *, jobject, jobject hotspot_method) { | 186 JNIEXPORT jobject JNICALL Java_com_oracle_max_graal_hotspot_bridge_CompilerToVMImpl_RiMethod_1methodData(JNIEnv *, jobject, jobject hotspot_method) { |
186 TRACE_graal_3("CompilerToVM::RiMethod_methodData"); | 187 TRACE_graal_3("CompilerToVM::RiMethod_methodData"); |
187 VM_ENTRY_MARK; | 188 VM_ENTRY_MARK; |
188 | 189 |
189 methodDataHandle method_data = getMethodFromHotSpotMethod(hotspot_method)->method_data(); | 190 methodDataHandle method_data = getMethodFromHotSpotMethod(hotspot_method)->method_data(); |
190 Handle graalMethodData = GraalCompiler::createHotSpotMethodData(method_data, THREAD); | 191 if(method_data.is_null()) { |
191 return JNIHandles::make_local(THREAD, graalMethodData()); | 192 return NULL; |
193 } else { | |
194 Handle graalMethodData = GraalCompiler::createHotSpotMethodData(method_data, THREAD); | |
195 return JNIHandles::make_local(THREAD, graalMethodData()); | |
196 } | |
192 } | 197 } |
193 | 198 |
194 // ------------------------------------------------------------------ | 199 // ------------------------------------------------------------------ |
195 // Adjust a CounterData count to be commensurate with | 200 // Adjust a CounterData count to be commensurate with |
196 // interpreter_invocation_count. If the MDO exists for | 201 // interpreter_invocation_count. If the MDO exists for |
896 #define EXCEPTION_HANDLERS "[Lcom/oracle/max/cri/ri/RiExceptionHandler;" | 901 #define EXCEPTION_HANDLERS "[Lcom/oracle/max/cri/ri/RiExceptionHandler;" |
897 #define TARGET_METHOD "Lcom/oracle/max/graal/hotspot/HotSpotTargetMethod;" | 902 #define TARGET_METHOD "Lcom/oracle/max/graal/hotspot/HotSpotTargetMethod;" |
898 #define CONFIG "Lcom/oracle/max/graal/hotspot/HotSpotVMConfig;" | 903 #define CONFIG "Lcom/oracle/max/graal/hotspot/HotSpotVMConfig;" |
899 #define HS_METHOD "Lcom/oracle/max/graal/hotspot/ri/HotSpotMethod;" | 904 #define HS_METHOD "Lcom/oracle/max/graal/hotspot/ri/HotSpotMethod;" |
900 #define HS_COMP_METHOD "Lcom/oracle/max/graal/hotspot/ri/HotSpotCompiledMethod;" | 905 #define HS_COMP_METHOD "Lcom/oracle/max/graal/hotspot/ri/HotSpotCompiledMethod;" |
901 #define METHOD_DATA "Lcom/oracle/max/graal/hotspot/HotSpotMethodData;" | 906 #define METHOD_DATA "Lcom/oracle/max/graal/hotspot/ri/HotSpotMethodData;" |
902 #define CI_CONSTANT "Lcom/oracle/max/cri/ci/CiConstant;" | 907 #define CI_CONSTANT "Lcom/oracle/max/cri/ci/CiConstant;" |
903 #define CI_KIND "Lcom/oracle/max/cri/ci/CiKind;" | 908 #define CI_KIND "Lcom/oracle/max/cri/ci/CiKind;" |
904 #define CI_RUNTIME_CALL "Lcom/oracle/max/cri/ci/CiRuntimeCall;" | 909 #define CI_RUNTIME_CALL "Lcom/oracle/max/cri/ci/CiRuntimeCall;" |
905 #define STRING "Ljava/lang/String;" | 910 #define STRING "Ljava/lang/String;" |
906 #define OBJECT "Ljava/lang/Object;" | 911 #define OBJECT "Ljava/lang/Object;" |
911 {CC"RiMethod_signature", CC"("RESOLVED_METHOD")"STRING, FN_PTR(RiMethod_1signature)}, | 916 {CC"RiMethod_signature", CC"("RESOLVED_METHOD")"STRING, FN_PTR(RiMethod_1signature)}, |
912 {CC"RiMethod_exceptionHandlers", CC"("RESOLVED_METHOD")"EXCEPTION_HANDLERS, FN_PTR(RiMethod_1exceptionHandlers)}, | 917 {CC"RiMethod_exceptionHandlers", CC"("RESOLVED_METHOD")"EXCEPTION_HANDLERS, FN_PTR(RiMethod_1exceptionHandlers)}, |
913 {CC"RiMethod_hasBalancedMonitors", CC"("RESOLVED_METHOD")Z", FN_PTR(RiMethod_1hasBalancedMonitors)}, | 918 {CC"RiMethod_hasBalancedMonitors", CC"("RESOLVED_METHOD")Z", FN_PTR(RiMethod_1hasBalancedMonitors)}, |
914 {CC"RiMethod_uniqueConcreteMethod", CC"("RESOLVED_METHOD")"METHOD, FN_PTR(RiMethod_1uniqueConcreteMethod)}, | 919 {CC"RiMethod_uniqueConcreteMethod", CC"("RESOLVED_METHOD")"METHOD, FN_PTR(RiMethod_1uniqueConcreteMethod)}, |
915 {CC"getRiMethod", CC"("REFLECT_METHOD")"METHOD, FN_PTR(getRiMethod)}, | 920 {CC"getRiMethod", CC"("REFLECT_METHOD")"METHOD, FN_PTR(getRiMethod)}, |
916 {CC"RiMethod_methodData", CC"("RESOLVED_METHOD"I)"METHOD_DATA, FN_PTR(RiMethod_1methodData)}, | 921 {CC"RiMethod_methodData", CC"("RESOLVED_METHOD")"METHOD_DATA, FN_PTR(RiMethod_1methodData)}, |
917 {CC"RiMethod_invocationCount", CC"("RESOLVED_METHOD")I", FN_PTR(RiMethod_1invocationCount)}, | 922 {CC"RiMethod_invocationCount", CC"("RESOLVED_METHOD")I", FN_PTR(RiMethod_1invocationCount)}, |
918 {CC"RiMethod_hasCompiledCode", CC"("RESOLVED_METHOD")Z", FN_PTR(RiMethod_1hasCompiledCode)}, | 923 {CC"RiMethod_hasCompiledCode", CC"("RESOLVED_METHOD")Z", FN_PTR(RiMethod_1hasCompiledCode)}, |
919 {CC"RiSignature_lookupType", CC"("STRING RESOLVED_TYPE")"TYPE, FN_PTR(RiSignature_1lookupType)}, | 924 {CC"RiSignature_lookupType", CC"("STRING RESOLVED_TYPE")"TYPE, FN_PTR(RiSignature_1lookupType)}, |
920 {CC"RiConstantPool_lookupConstant", CC"("RESOLVED_TYPE"I)"OBJECT, FN_PTR(RiConstantPool_1lookupConstant)}, | 925 {CC"RiConstantPool_lookupConstant", CC"("RESOLVED_TYPE"I)"OBJECT, FN_PTR(RiConstantPool_1lookupConstant)}, |
921 {CC"RiConstantPool_lookupMethod", CC"("RESOLVED_TYPE"IB)"METHOD, FN_PTR(RiConstantPool_1lookupMethod)}, | 926 {CC"RiConstantPool_lookupMethod", CC"("RESOLVED_TYPE"IB)"METHOD, FN_PTR(RiConstantPool_1lookupMethod)}, |