comparison src/share/vm/code/codeBlob.cpp @ 6796:b31471cdc53e

7200163: add CodeComments functionality to assember stubs Summary: Pass the codeBuffer to the Stub constructor, and adapts the disassembler to print the comments. Reviewed-by: jrose, kvn, twisti Contributed-by: goetz.lindenmaier@sap.com
author kvn
date Mon, 24 Sep 2012 10:30:14 -0700
parents da91efe96a93
children 7d815d842ee0 a5de0cc2f91c
comparison
equal deleted inserted replaced
6795:7eca5de9e0b6 6796:b31471cdc53e
160 if (stub != NULL) { 160 if (stub != NULL) {
161 char stub_id[256]; 161 char stub_id[256];
162 assert(strlen(name1) + strlen(name2) < sizeof(stub_id), ""); 162 assert(strlen(name1) + strlen(name2) < sizeof(stub_id), "");
163 jio_snprintf(stub_id, sizeof(stub_id), "%s%s", name1, name2); 163 jio_snprintf(stub_id, sizeof(stub_id), "%s%s", name1, name2);
164 if (PrintStubCode) { 164 if (PrintStubCode) {
165 ttyLocker ttyl;
165 tty->print_cr("Decoding %s " INTPTR_FORMAT, stub_id, (intptr_t) stub); 166 tty->print_cr("Decoding %s " INTPTR_FORMAT, stub_id, (intptr_t) stub);
166 Disassembler::decode(stub->code_begin(), stub->code_end()); 167 Disassembler::decode(stub->code_begin(), stub->code_end());
168 tty->cr();
167 } 169 }
168 Forte::register_stub(stub_id, stub->code_begin(), stub->code_end()); 170 Forte::register_stub(stub_id, stub->code_begin(), stub->code_end());
169 171
170 if (JvmtiExport::should_post_dynamic_code_generated()) { 172 if (JvmtiExport::should_post_dynamic_code_generated()) {
171 const char* stub_name = name2; 173 const char* stub_name = name2;
546 void RuntimeStub::verify() { 548 void RuntimeStub::verify() {
547 // unimplemented 549 // unimplemented
548 } 550 }
549 551
550 void RuntimeStub::print_on(outputStream* st) const { 552 void RuntimeStub::print_on(outputStream* st) const {
553 ttyLocker ttyl;
551 CodeBlob::print_on(st); 554 CodeBlob::print_on(st);
552 st->print("Runtime Stub (" INTPTR_FORMAT "): ", this); 555 st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
553 st->print_cr(name()); 556 st->print_cr(name());
554 Disassembler::decode((CodeBlob*)this, st); 557 Disassembler::decode((CodeBlob*)this, st);
555 } 558 }
561 void SingletonBlob::verify() { 564 void SingletonBlob::verify() {
562 // unimplemented 565 // unimplemented
563 } 566 }
564 567
565 void SingletonBlob::print_on(outputStream* st) const { 568 void SingletonBlob::print_on(outputStream* st) const {
569 ttyLocker ttyl;
566 CodeBlob::print_on(st); 570 CodeBlob::print_on(st);
567 st->print_cr(name()); 571 st->print_cr(name());
568 Disassembler::decode((CodeBlob*)this, st); 572 Disassembler::decode((CodeBlob*)this, st);
569 } 573 }
570 574