comparison src/share/vm/graal/graalCompilerToVM.cpp @ 5238:cce31bc56c00

made HotSpotResolvedMethodImpl.toStackTraceElement() call into native code to get an object containing source file info
author Doug Simon <doug.simon@oracle.com>
date Fri, 13 Apr 2012 11:15:36 +0200
parents ae72dd38eeb1
children 8bf2c37c46c4
comparison
equal deleted inserted replaced
5237:8c7e786886d0 5238:cce31bc56c00
951 951
952 Handle result = java_lang_String::create_from_platform_dependent_str(st.as_string(), CHECK_NULL); 952 Handle result = java_lang_String::create_from_platform_dependent_str(st.as_string(), CHECK_NULL);
953 return JNIHandles::make_local(result()); 953 return JNIHandles::make_local(result());
954 } 954 }
955 955
956 // public StackTraceElement RiMethod_toStackTraceElement(HotSpotMethodResolved method, int bci);
957 JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_RiMethod_1toStackTraceElement(JNIEnv *env, jobject, jobject hotspot_method, int bci) {
958 TRACE_graal_3("CompilerToVM::RiMethod_toStackTraceElement");
959
960 VM_ENTRY_MARK;
961 ResourceMark rm;
962 HandleMark hm;
963
964 methodHandle method = getMethodFromHotSpotMethod(hotspot_method);
965 oop element = java_lang_StackTraceElement::create(method, bci, CHECK_NULL);
966 return JNIHandles::make_local(element);
967 }
968
956 // public Object executeCompiledMethod(HotSpotCompiledMethod method, Object arg1, Object arg2, Object arg3); 969 // public Object executeCompiledMethod(HotSpotCompiledMethod method, Object arg1, Object arg2, Object arg3);
957 JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_executeCompiledMethod(JNIEnv *env, jobject, jobject method, jobject arg1, jobject arg2, jobject arg3) { 970 JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_executeCompiledMethod(JNIEnv *env, jobject, jobject method, jobject arg1, jobject arg2, jobject arg3) {
958 TRACE_graal_3("CompilerToVM::executeCompiledMethod"); 971 TRACE_graal_3("CompilerToVM::executeCompiledMethod");
959 972
960 VM_ENTRY_MARK; 973 VM_ENTRY_MARK;
1033 #define CI_KIND "Lcom/oracle/max/cri/ci/CiKind;" 1046 #define CI_KIND "Lcom/oracle/max/cri/ci/CiKind;"
1034 #define CI_RUNTIME_CALL "Lcom/oracle/max/cri/ci/CiRuntimeCall;" 1047 #define CI_RUNTIME_CALL "Lcom/oracle/max/cri/ci/CiRuntimeCall;"
1035 #define STRING "Ljava/lang/String;" 1048 #define STRING "Ljava/lang/String;"
1036 #define OBJECT "Ljava/lang/Object;" 1049 #define OBJECT "Ljava/lang/Object;"
1037 #define CLASS "Ljava/lang/Class;" 1050 #define CLASS "Ljava/lang/Class;"
1051 #define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;"
1038 1052
1039 JNINativeMethod CompilerToVM_methods[] = { 1053 JNINativeMethod CompilerToVM_methods[] = {
1040 {CC"RiMethod_code", CC"("RESOLVED_METHOD")[B", FN_PTR(RiMethod_1code)}, 1054 {CC"RiMethod_code", CC"("RESOLVED_METHOD")[B", FN_PTR(RiMethod_1code)},
1041 {CC"RiMethod_signature", CC"("RESOLVED_METHOD")"STRING, FN_PTR(RiMethod_1signature)}, 1055 {CC"RiMethod_signature", CC"("RESOLVED_METHOD")"STRING, FN_PTR(RiMethod_1signature)},
1042 {CC"RiMethod_exceptionHandlers", CC"("RESOLVED_METHOD")"EXCEPTION_HANDLERS, FN_PTR(RiMethod_1exceptionHandlers)}, 1056 {CC"RiMethod_exceptionHandlers", CC"("RESOLVED_METHOD")"EXCEPTION_HANDLERS, FN_PTR(RiMethod_1exceptionHandlers)},
1068 {CC"getConfiguration", CC"()"CONFIG, FN_PTR(getConfiguration)}, 1082 {CC"getConfiguration", CC"()"CONFIG, FN_PTR(getConfiguration)},
1069 {CC"installMethod", CC"("TARGET_METHOD"Z)"HS_COMP_METHOD, FN_PTR(installMethod)}, 1083 {CC"installMethod", CC"("TARGET_METHOD"Z)"HS_COMP_METHOD, FN_PTR(installMethod)},
1070 {CC"installStub", CC"("TARGET_METHOD")"PROXY, FN_PTR(installStub)}, 1084 {CC"installStub", CC"("TARGET_METHOD")"PROXY, FN_PTR(installStub)},
1071 {CC"disassembleNative", CC"([BJ)"STRING, FN_PTR(disassembleNative)}, 1085 {CC"disassembleNative", CC"([BJ)"STRING, FN_PTR(disassembleNative)},
1072 {CC"disassembleJava", CC"("RESOLVED_METHOD")"STRING, FN_PTR(disassembleJava)}, 1086 {CC"disassembleJava", CC"("RESOLVED_METHOD")"STRING, FN_PTR(disassembleJava)},
1087 {CC"RiMethod_toStackTraceElement", CC"("RESOLVED_METHOD"I)"STACK_TRACE_ELEMENT, FN_PTR(RiMethod_1toStackTraceElement)},
1073 {CC"executeCompiledMethod", CC"("HS_COMP_METHOD OBJECT OBJECT OBJECT")"OBJECT, FN_PTR(executeCompiledMethod)}, 1088 {CC"executeCompiledMethod", CC"("HS_COMP_METHOD OBJECT OBJECT OBJECT")"OBJECT, FN_PTR(executeCompiledMethod)},
1074 {CC"RiMethod_vtableEntryOffset", CC"("RESOLVED_METHOD")I", FN_PTR(RiMethod_vtableEntryOffset)}, 1089 {CC"RiMethod_vtableEntryOffset", CC"("RESOLVED_METHOD")I", FN_PTR(RiMethod_vtableEntryOffset)},
1075 {CC"getDeoptedLeafGraphIds", CC"()[J", FN_PTR(getDeoptedLeafGraphIds)}, 1090 {CC"getDeoptedLeafGraphIds", CC"()[J", FN_PTR(getDeoptedLeafGraphIds)},
1076 }; 1091 };
1077 1092