diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 11e070862fe..f0769e240dd 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -1767,9 +1767,13 @@ void CodeCache::print_codelist(outputStream* st) { nmethod* nm = iter.method(); ResourceMark rm; char* method_name = nm->method()->name_and_sig_as_C_string(); - st->print_cr("%d %d %d %s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]", + const char* jvmci_name = nullptr; +#if INCLUDE_JVMCI + jvmci_name = nm->jvmci_name(); +#endif + st->print_cr("%d %d %d %s%s%s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]", nm->compile_id(), nm->comp_level(), nm->get_state(), - method_name, + method_name, jvmci_name ? " jvmci_name=" : "", jvmci_name ? jvmci_name : "", (intptr_t)nm->header_begin(), (intptr_t)nm->code_begin(), (intptr_t)nm->code_end()); } } @@ -1811,12 +1815,20 @@ void CodeCache::write_perf_map(const char* filename, outputStream* st) { while (iter.next()) { CodeBlob *cb = iter.method(); ResourceMark rm; - const char* method_name = - cb->is_nmethod() ? cb->as_nmethod()->method()->external_name() - : cb->name(); - fs.print_cr(INTPTR_FORMAT " " INTPTR_FORMAT " %s", + const char* method_name = nullptr; + const char* jvmci_name = nullptr; + if (cb->is_nmethod()) { + nmethod* nm = cb->as_nmethod(); + method_name = nm->method()->external_name(); +#if INCLUDE_JVMCI + jvmci_name = nm->jvmci_name(); +#endif + } else { + method_name = cb->name(); + } + fs.print_cr(INTPTR_FORMAT " " INTPTR_FORMAT " %s%s%s", (intptr_t)cb->code_begin(), (intptr_t)cb->code_size(), - method_name); + method_name, jvmci_name ? " jvmci_name=" : "", jvmci_name ? jvmci_name : ""); } } #endif // LINUX diff --git a/src/hotspot/share/code/codeHeapState.cpp b/src/hotspot/share/code/codeHeapState.cpp index 48c8410ac47..1ea3f258dd2 100644 --- a/src/hotspot/share/code/codeHeapState.cpp +++ b/src/hotspot/share/code/codeHeapState.cpp @@ -735,7 +735,16 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular } else { blob_name = os::strdup(cb->name()); } - +#if INCLUDE_JVMCI + const char* jvmci_name = nm->jvmci_name(); + if (jvmci_name != nullptr) { + size_t size = ::strlen(blob_name) + ::strlen(" jvmci_name=") + ::strlen(jvmci_name) + 1; + char* new_blob_name = (char*)os::malloc(size, mtInternal); + os::snprintf(new_blob_name, size, "%s jvmci_name=%s", blob_name, jvmci_name); + os::free((void*)blob_name); + blob_name = new_blob_name; + } +#endif nm_size = nm->total_size(); compile_id = nm->compile_id(); comp_lvl = (CompLevel)(nm->comp_level()); @@ -2184,6 +2193,12 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) { ast->print("%s.", classNameS); ast->print("%s", methNameS); ast->print("%s", methSigS); +#if INCLUDE_JVMCI + const char* jvmci_name = nm->jvmci_name(); + if (jvmci_name != nullptr) { + ast->print(" jvmci_name=%s", jvmci_name); + } +#endif } else { ast->print("%s", blob_name); }