# HG changeset patch # User iklam # Date 1449508766 28800 # Node ID 382588e9104a15a55f555d2f1dc9617aaa68e5d1 # Parent 1db5f63bda7c127f8c58bfc4cae09316b82412c3 8144853: Print the names of callees in PrintAssembly/PrintInterpreter Reviewed-by: dholmes, vlivanov diff -r 1db5f63bda7c -r 382588e9104a hotspot/src/share/vm/code/nmethod.cpp --- a/hotspot/src/share/vm/code/nmethod.cpp Tue Dec 15 17:57:08 2015 +0000 +++ b/hotspot/src/share/vm/code/nmethod.cpp Mon Dec 07 09:19:26 2015 -0800 @@ -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,17 @@ CodeBlob* cb = CodeCache::find_blob(dest); if (cb != NULL) { st.print(" %s", cb->name()); + } else { + ResourceMark rm; + const int buflen = 1024; + char* buf = NEW_RESOURCE_ARRAY(char, buflen); + int offset; + if (os::dll_address_to_function_name(dest, buf, buflen, &offset)) { + st.print(" %s", buf); + if (offset != 0) { + st.print("+%d", offset); + } + } } return st.as_string(); } diff -r 1db5f63bda7c -r 382588e9104a hotspot/src/share/vm/compiler/disassembler.cpp --- a/hotspot/src/share/vm/compiler/disassembler.cpp Tue Dec 15 17:57:08 2015 +0000 +++ b/hotspot/src/share/vm/compiler/disassembler.cpp Mon Dec 07 09:19:26 2015 -0800 @@ -360,6 +360,22 @@ } } + if (_nm == NULL) { + // Don't do this for native methods, as the function name will be printed in + // nmethod::reloc_string_for(). + ResourceMark rm; + const int buflen = 1024; + char* buf = NEW_RESOURCE_ARRAY(char, buflen); + int offset; + if (os::dll_address_to_function_name(adr, buf, buflen, &offset)) { + st->print(PTR_FORMAT " = %s", p2i(adr), buf); + if (offset != 0) { + st->print("+%d", offset); + } + return; + } + } + // Fall through to a simple (hexadecimal) numeral. st->print(PTR_FORMAT, p2i(adr)); }