# HG changeset patch # User iklam # Date 1449508766 28800 # Mon Dec 07 09:19:26 2015 -0800 # Node ID 368b2f6137d32224731828dfe16e9f18c6e43a7d # Parent 212fe7a3d74c47bee3a5c5e6b3203ad5e50bbd2e 8144853: Print the names of callees in PrintAssembly/PrintInterpreter Reviewed-by: xxx, yyy diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp +++ b/src/share/vm/code/nmethod.cpp @@ -41,6 +41,7 @@ #include "prims/jvmtiImpl.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.inline.hpp" +#include "runtime/os.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp" #include "utilities/resourceHash.hpp" @@ -3050,6 +3051,18 @@ CodeBlob* cb = CodeCache::find_blob(dest); if (cb != NULL) { st.print(" %s", cb->name()); + } else { + static char buf[O_BUFLEN]; + int offset; + bool found; + found = os::dll_address_to_function_name(dest, buf, sizeof(buf), &offset); + + if (found) { + st.print(" %s", buf); + if (offset != 0) { + st.print("+%d", offset); + } + } } return st.as_string(); } diff --git a/src/share/vm/compiler/disassembler.cpp b/src/share/vm/compiler/disassembler.cpp --- a/src/share/vm/compiler/disassembler.cpp +++ b/src/share/vm/compiler/disassembler.cpp @@ -361,7 +361,20 @@ } // Fall through to a simple (hexadecimal) numeral. - st->print(PTR_FORMAT, p2i(adr)); + static char buf[O_BUFLEN]; + int offset; + bool found; + + if (_nm == NULL && os::dll_address_to_function_name(adr, buf, sizeof(buf), &offset)) { + // Don't do this for native methods, as the function name will be printed in + // by nmethod::reloc_string_for(). + st->print(" " PTR_FORMAT " = %s", p2i(adr), buf); + if (offset != 0) { + st->print("+%d", offset); + } + } else { + st->print(" " PTR_FORMAT, p2i(adr)); + } } void decode_env::print_insn_labels() {