6912062: disassembler plugin needs to produce symbolic information in product mode

More informative disassembly in product mode.  Also, a more consistent CompileCommand syntax.

Reviewed-by: never
This commit is contained in:
John R Rose 2010-01-08 13:47:01 -08:00
parent 7548b8eed5
commit fdbb64ef71
39 changed files with 262 additions and 128 deletions

View file

@ -31,14 +31,13 @@ BarrierSet* oopDesc::_bs = NULL;
#ifdef PRODUCT
void oopDesc::print_on(outputStream* st) const {}
void oopDesc::print_value_on(outputStream* st) const {}
void oopDesc::print_address_on(outputStream* st) const {}
char* oopDesc::print_value_string() { return NULL; }
char* oopDesc::print_string() { return NULL; }
void oopDesc::print() {}
void oopDesc::print_value() {}
void oopDesc::print_address() {}
#else
#else //PRODUCT
void oopDesc::print_on(outputStream* st) const {
if (this == NULL) {
st->print_cr("NULL");
@ -47,22 +46,6 @@ void oopDesc::print_on(outputStream* st) const {
}
}
void oopDesc::print_value_on(outputStream* st) const {
oop obj = oop(this);
if (this == NULL) {
st->print("NULL");
} else if (java_lang_String::is_instance(obj)) {
java_lang_String::print(obj, st);
if (PrintOopAddress) print_address_on(st);
#ifdef ASSERT
} else if (!Universe::heap()->is_in(obj) || !Universe::heap()->is_in(klass())) {
st->print("### BAD OOP %p ###", (address)obj);
#endif
} else {
blueprint()->oop_print_value_on(obj, st);
}
}
void oopDesc::print_address_on(outputStream* st) const {
if (PrintOopAddress) {
st->print("{"INTPTR_FORMAT"}", this);
@ -71,24 +54,48 @@ void oopDesc::print_address_on(outputStream* st) const {
void oopDesc::print() { print_on(tty); }
void oopDesc::print_value() { print_value_on(tty); }
void oopDesc::print_address() { print_address_on(tty); }
char* oopDesc::print_string() {
stringStream* st = new stringStream();
print_on(st);
return st->as_string();
}
char* oopDesc::print_value_string() {
stringStream* st = new stringStream();
print_value_on(st);
return st->as_string();
stringStream st;
print_on(&st);
return st.as_string();
}
#endif // PRODUCT
// The print_value functions are present in all builds, to support the disassembler.
void oopDesc::print_value() {
print_value_on(tty);
}
char* oopDesc::print_value_string() {
char buf[100];
stringStream st(buf, sizeof(buf));
print_value_on(&st);
return st.as_string();
}
void oopDesc::print_value_on(outputStream* st) const {
oop obj = oop(this);
if (this == NULL) {
st->print("NULL");
} else if (java_lang_String::is_instance(obj)) {
java_lang_String::print(obj, st);
#ifndef PRODUCT
if (PrintOopAddress) print_address_on(st);
#endif //PRODUCT
#ifdef ASSERT
} else if (!Universe::heap()->is_in(obj) || !Universe::heap()->is_in(klass())) {
st->print("### BAD OOP %p ###", (address)obj);
#endif //ASSERT
} else {
blueprint()->oop_print_value_on(obj, st);
}
}
void oopDesc::verify_on(outputStream* st) {
if (this != NULL) {
blueprint()->oop_verify_on(this, st);