7200163: add CodeComments functionality to assember stubs

Pass the codeBuffer to the Stub constructor, and adapts the disassembler to print the comments.

Reviewed-by: jrose, kvn, twisti
This commit is contained in:
Goetz Lindenmaier 2012-09-24 10:30:14 -07:00 committed by Vladimir Kozlov
parent 302540691b
commit 5ada196961
14 changed files with 73 additions and 42 deletions

View file

@ -162,8 +162,10 @@ void CodeBlob::trace_new_stub(CodeBlob* stub, const char* name1, const char* nam
assert(strlen(name1) + strlen(name2) < sizeof(stub_id), "");
jio_snprintf(stub_id, sizeof(stub_id), "%s%s", name1, name2);
if (PrintStubCode) {
ttyLocker ttyl;
tty->print_cr("Decoding %s " INTPTR_FORMAT, stub_id, (intptr_t) stub);
Disassembler::decode(stub->code_begin(), stub->code_end());
tty->cr();
}
Forte::register_stub(stub_id, stub->code_begin(), stub->code_end());
@ -548,6 +550,7 @@ void RuntimeStub::verify() {
}
void RuntimeStub::print_on(outputStream* st) const {
ttyLocker ttyl;
CodeBlob::print_on(st);
st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
st->print_cr(name());
@ -563,6 +566,7 @@ void SingletonBlob::verify() {
}
void SingletonBlob::print_on(outputStream* st) const {
ttyLocker ttyl;
CodeBlob::print_on(st);
st->print_cr(name());
Disassembler::decode((CodeBlob*)this, st);