Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCompilerToVM.cpp @ 5318:b5cd7bc05695
Method entry counters: Enable the flag to collect an execution profile of compiled methods and their callers. This allows to, e.g., detect methods that should be inlined because they are called frequently.
author | Christian Wimmer <Christian.Wimmer@Oracle.com> |
---|---|
date | Fri, 27 Apr 2012 12:56:39 -0700 |
parents | 290b3025b66f |
children | fc1943f18fef |
comparison
equal
deleted
inserted
replaced
5317:c8c234c05877 | 5318:b5cd7bc05695 |
---|---|
1109 | 1109 |
1110 oop array = GraalCompiler::instance()->dump_deopted_leaf_graphs(CHECK_NULL); | 1110 oop array = GraalCompiler::instance()->dump_deopted_leaf_graphs(CHECK_NULL); |
1111 return JNIHandles::make_local(array); | 1111 return JNIHandles::make_local(array); |
1112 } | 1112 } |
1113 | 1113 |
1114 JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_decodePC(JNIEnv *, jobject, jlong pc) { | |
1115 TRACE_graal_3("CompilerToVM::decodePC"); | |
1116 | |
1117 VM_ENTRY_MARK; | |
1118 | |
1119 stringStream(st); | |
1120 CodeBlob* blob = CodeCache::find_blob_unsafe((void*) pc); | |
1121 if (blob == NULL) { | |
1122 st.print("[unidentified pc]"); | |
1123 } else { | |
1124 st.print(blob->name()); | |
1125 | |
1126 nmethod* nm = blob->as_nmethod_or_null(); | |
1127 if (nm != NULL && nm->method() != NULL) { | |
1128 st.print(" %s.", nm->method()->method_holder()->klass_part()->external_name()); | |
1129 nm->method()->name()->print_symbol_on(&st); | |
1130 st.print(" @ %d", pc - (jlong) nm->entry_point()); | |
1131 } | |
1132 } | |
1133 Handle result = java_lang_String::create_from_platform_dependent_str(st.as_string(), CHECK_NULL); | |
1134 return JNIHandles::make_local(result()); | |
1135 | |
1136 } | |
1137 | |
1114 | 1138 |
1115 #define CC (char*) /*cast a literal from (const char*)*/ | 1139 #define CC (char*) /*cast a literal from (const char*)*/ |
1116 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_##f)) | 1140 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_##f)) |
1117 | 1141 |
1118 #define PROXY "J" | 1142 #define PROXY "J" |
1177 {CC"RiMethod_toStackTraceElement", CC"("RESOLVED_METHOD"I)"STACK_TRACE_ELEMENT, FN_PTR(RiMethod_1toStackTraceElement)}, | 1201 {CC"RiMethod_toStackTraceElement", CC"("RESOLVED_METHOD"I)"STACK_TRACE_ELEMENT, FN_PTR(RiMethod_1toStackTraceElement)}, |
1178 {CC"executeCompiledMethod", CC"("HS_COMP_METHOD OBJECT OBJECT OBJECT")"OBJECT, FN_PTR(executeCompiledMethod)}, | 1202 {CC"executeCompiledMethod", CC"("HS_COMP_METHOD OBJECT OBJECT OBJECT")"OBJECT, FN_PTR(executeCompiledMethod)}, |
1179 {CC"executeCompiledMethodVarargs", CC"("HS_COMP_METHOD "["OBJECT")"OBJECT, FN_PTR(executeCompiledMethodVarargs)}, | 1203 {CC"executeCompiledMethodVarargs", CC"("HS_COMP_METHOD "["OBJECT")"OBJECT, FN_PTR(executeCompiledMethodVarargs)}, |
1180 {CC"RiMethod_vtableEntryOffset", CC"("RESOLVED_METHOD")I", FN_PTR(RiMethod_vtableEntryOffset)}, | 1204 {CC"RiMethod_vtableEntryOffset", CC"("RESOLVED_METHOD")I", FN_PTR(RiMethod_vtableEntryOffset)}, |
1181 {CC"getDeoptedLeafGraphIds", CC"()[J", FN_PTR(getDeoptedLeafGraphIds)}, | 1205 {CC"getDeoptedLeafGraphIds", CC"()[J", FN_PTR(getDeoptedLeafGraphIds)}, |
1206 {CC"decodePC", CC"(J)"STRING, FN_PTR(decodePC)}, | |
1182 }; | 1207 }; |
1183 | 1208 |
1184 int CompilerToVM_methods_count() { | 1209 int CompilerToVM_methods_count() { |
1185 return sizeof(CompilerToVM_methods) / sizeof(JNINativeMethod); | 1210 return sizeof(CompilerToVM_methods) / sizeof(JNINativeMethod); |
1186 } | 1211 } |