488 &printf_to_env, (void*) this, 489 options(), 0/*nice new line*/) 490 : 491 (address) 492 (*Disassembler::_decode_instructions)(start, end, 493 &event_to_env, (void*) this, 494 &printf_to_env, (void*) this, 495 options()); 496 } 497 498 499 void Disassembler::decode(CodeBlob* cb, outputStream* st) { 500 ttyLocker ttyl; 501 if (!load_library()) return; 502 if (cb->is_nmethod()) { 503 decode((nmethod*)cb, st); 504 return; 505 } 506 decode_env env(cb, st); 507 env.output()->print_cr("----------------------------------------------------------------------"); 508 env.output()->print_cr("%s", cb->name()); 509 env.output()->print_cr(" at [" PTR_FORMAT ", " PTR_FORMAT "] " JLONG_FORMAT " bytes", p2i(cb->code_begin()), p2i(cb->code_end()), ((jlong)(cb->code_end() - cb->code_begin())) * sizeof(unsigned char*)); 510 env.decode_instructions(cb->code_begin(), cb->code_end()); 511 } 512 513 void Disassembler::decode(address start, address end, outputStream* st, CodeStrings c) { 514 ttyLocker ttyl; 515 if (!load_library()) return; 516 decode_env env(CodeCache::find_blob_unsafe(start), st, c); 517 env.decode_instructions(start, end); 518 } 519 520 void Disassembler::decode(nmethod* nm, outputStream* st) { 521 ttyLocker ttyl; 522 if (!load_library()) return; 523 decode_env env(nm, st); 524 env.output()->print_cr("----------------------------------------------------------------------"); 525 526 #ifdef SHARK 527 SharkEntry* entry = (SharkEntry *) nm->code_begin(); 528 unsigned char* p = entry->code_start(); | 488 &printf_to_env, (void*) this, 489 options(), 0/*nice new line*/) 490 : 491 (address) 492 (*Disassembler::_decode_instructions)(start, end, 493 &event_to_env, (void*) this, 494 &printf_to_env, (void*) this, 495 options()); 496 } 497 498 499 void Disassembler::decode(CodeBlob* cb, outputStream* st) { 500 ttyLocker ttyl; 501 if (!load_library()) return; 502 if (cb->is_nmethod()) { 503 decode((nmethod*)cb, st); 504 return; 505 } 506 decode_env env(cb, st); 507 env.output()->print_cr("----------------------------------------------------------------------"); 508 if (cb->is_aot()) { 509 env.output()->print("A "); 510 if (cb->is_compiled()) { 511 CompiledMethod* cm = (CompiledMethod*)cb; 512 env.output()->print("%d ",cm->compile_id()); 513 cm->method()->method_holder()->name()->print_symbol_on(env.output()); 514 env.output()->print("."); 515 cm->method()->name()->print_symbol_on(env.output()); 516 cm->method()->signature()->print_symbol_on(env.output()); 517 } else { 518 env.output()->print_cr("%s", cb->name()); 519 } 520 } else { 521 env.output()->print_cr("%s", cb->name()); 522 } 523 env.output()->print_cr(" at [" PTR_FORMAT ", " PTR_FORMAT "] " JLONG_FORMAT " bytes", p2i(cb->code_begin()), p2i(cb->code_end()), ((jlong)(cb->code_end() - cb->code_begin())) * sizeof(unsigned char*)); 524 env.decode_instructions(cb->code_begin(), cb->code_end()); 525 } 526 527 void Disassembler::decode(address start, address end, outputStream* st, CodeStrings c) { 528 ttyLocker ttyl; 529 if (!load_library()) return; 530 decode_env env(CodeCache::find_blob_unsafe(start), st, c); 531 env.decode_instructions(start, end); 532 } 533 534 void Disassembler::decode(nmethod* nm, outputStream* st) { 535 ttyLocker ttyl; 536 if (!load_library()) return; 537 decode_env env(nm, st); 538 env.output()->print_cr("----------------------------------------------------------------------"); 539 540 #ifdef SHARK 541 SharkEntry* entry = (SharkEntry *) nm->code_begin(); 542 unsigned char* p = entry->code_start(); |