8136421: JEP 243: Java-Level JVM Compiler Interface

Reviewed-by: ihse, alanb, roland, coleenp, iveresov, kvn, kbarrett
This commit is contained in:
Christian Thalinger 2015-10-08 12:49:30 -10:00
parent f5b4bb46f5
commit 16526e000e
505 changed files with 50394 additions and 915 deletions

View file

@ -487,8 +487,14 @@ address decode_env::decode_instructions(address start, address end) {
void Disassembler::decode(CodeBlob* cb, outputStream* st) {
if (!load_library()) return;
if (cb->is_nmethod()) {
decode((nmethod*)cb, st);
return;
}
decode_env env(cb, st);
env.output()->print_cr("Decoding CodeBlob " PTR_FORMAT, cb);
env.output()->print_cr("----------------------------------------------------------------------");
env.output()->print_cr("%s", cb->name());
env.output()->print_cr(" at [" PTR_FORMAT ", " PTR_FORMAT "] %d bytes", cb->code_begin(), cb->code_end(), ((jlong)(cb->code_end() - cb->code_begin())) * sizeof(unsigned char*));
env.decode_instructions(cb->code_begin(), cb->code_end());
}
@ -501,8 +507,7 @@ void Disassembler::decode(address start, address end, outputStream* st, CodeStri
void Disassembler::decode(nmethod* nm, outputStream* st) {
if (!load_library()) return;
decode_env env(nm, st);
env.output()->print_cr("Decoding compiled method " PTR_FORMAT ":", nm);
env.output()->print_cr("Code:");
env.output()->print_cr("----------------------------------------------------------------------");
#ifdef SHARK
SharkEntry* entry = (SharkEntry *) nm->code_begin();
@ -513,6 +518,21 @@ void Disassembler::decode(nmethod* nm, outputStream* st) {
unsigned char* end = nm->code_end();
#endif // SHARK
nm->method()->method_holder()->name()->print_symbol_on(env.output());
env.output()->print(".");
nm->method()->name()->print_symbol_on(env.output());
nm->method()->signature()->print_symbol_on(env.output());
#if INCLUDE_JVMCI
{
char buffer[O_BUFLEN];
char* jvmciName = nm->jvmci_installed_code_name(buffer, O_BUFLEN);
if (jvmciName != NULL) {
env.output()->print(" (%s)", jvmciName);
}
}
#endif
env.output()->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT "] %d bytes", p, end, ((jlong)(end - p)));
// If there has been profiling, print the buckets.
if (FlatProfiler::bucket_start_for(p) != NULL) {
unsigned char* p1 = p;