8144853: Print the names of callees in PrintAssembly/PrintInterpreter

Reviewed-by: dholmes, vlivanov
This commit is contained in:
Ioi Lam 2015-12-07 09:19:26 -08:00
parent d0532b2b86
commit 9c775566e5
2 changed files with 28 additions and 0 deletions

View file

@ -41,6 +41,7 @@
#include "prims/jvmtiImpl.hpp" #include "prims/jvmtiImpl.hpp"
#include "runtime/atomic.inline.hpp" #include "runtime/atomic.inline.hpp"
#include "runtime/orderAccess.inline.hpp" #include "runtime/orderAccess.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#include "runtime/sweeper.hpp" #include "runtime/sweeper.hpp"
#include "utilities/resourceHash.hpp" #include "utilities/resourceHash.hpp"
@ -3050,6 +3051,17 @@ const char* nmethod::reloc_string_for(u_char* begin, u_char* end) {
CodeBlob* cb = CodeCache::find_blob(dest); CodeBlob* cb = CodeCache::find_blob(dest);
if (cb != NULL) { if (cb != NULL) {
st.print(" %s", cb->name()); 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(); return st.as_string();
} }

View file

@ -360,6 +360,22 @@ void decode_env::print_address(address adr) {
} }
} }
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. // Fall through to a simple (hexadecimal) numeral.
st->print(PTR_FORMAT, p2i(adr)); st->print(PTR_FORMAT, p2i(adr));
} }