6621094: PrintOptoAssembly is broken for oops information in DebugInfo

OopMapValue and VMRegImpl classes miss the virtual method print_on(st).

Reviewed-by: rasbold, jrose, never
This commit is contained in:
Vladimir Kozlov 2008-02-20 17:23:43 -08:00
parent 5ade869e8c
commit 26097e9848
4 changed files with 26 additions and 24 deletions

View File

@ -36,16 +36,16 @@ const int VMRegImpl::register_count = ConcreteRegisterImpl::number_of_registers;
// Register names // Register names
const char *VMRegImpl::regName[ConcreteRegisterImpl::number_of_registers]; const char *VMRegImpl::regName[ConcreteRegisterImpl::number_of_registers];
void VMRegImpl::print() {
#ifndef PRODUCT #ifndef PRODUCT
void VMRegImpl::print_on(outputStream* st) const {
if( is_reg() ) { if( is_reg() ) {
assert( VMRegImpl::regName[value()], "" ); assert( VMRegImpl::regName[value()], "" );
tty->print("%s",VMRegImpl::regName[value()]); st->print("%s",VMRegImpl::regName[value()]);
} else if (is_stack()) { } else if (is_stack()) {
int stk = value() - stack0->value(); int stk = value() - stack0->value();
tty->print("[%d]", stk*4); st->print("[%d]", stk*4);
} else { } else {
tty->print("BAD!"); st->print("BAD!");
} }
#endif // PRODUCT
} }
#endif // PRODUCT

View File

@ -66,9 +66,9 @@ public:
} }
} }
static VMReg Bad() { return (VMReg) (intptr_t) BAD; } static VMReg Bad() { return (VMReg) (intptr_t) BAD; }
bool is_valid() { return ((intptr_t) this) != BAD; } bool is_valid() const { return ((intptr_t) this) != BAD; }
bool is_stack() { return (intptr_t) this >= (intptr_t) stack0; } bool is_stack() const { return (intptr_t) this >= (intptr_t) stack0; }
bool is_reg() { return is_valid() && !is_stack(); } bool is_reg() const { return is_valid() && !is_stack(); }
// A concrete register is a value that returns true for is_reg() and is // A concrete register is a value that returns true for is_reg() and is
// also a register you could use in the assembler. On machines with // also a register you could use in the assembler. On machines with
@ -96,7 +96,8 @@ public:
intptr_t value() const {return (intptr_t) this; } intptr_t value() const {return (intptr_t) this; }
void print(); void print_on(outputStream* st) const PRODUCT_RETURN;
void print() const { print_on(tty); }
// bias a stack slot. // bias a stack slot.
// Typically used to adjust a virtual frame slots by amounts that are offset by // Typically used to adjust a virtual frame slots by amounts that are offset by

View File

@ -506,27 +506,27 @@ bool OopMap::has_derived_pointer() const {
} }
void print_register_type(OopMapValue::oop_types x, VMReg optional) { static void print_register_type(OopMapValue::oop_types x, VMReg optional, outputStream* st) {
switch( x ) { switch( x ) {
case OopMapValue::oop_value: case OopMapValue::oop_value:
tty->print("Oop"); st->print("Oop");
break; break;
case OopMapValue::value_value: case OopMapValue::value_value:
tty->print("Value" ); st->print("Value" );
break; break;
case OopMapValue::dead_value: case OopMapValue::dead_value:
tty->print("Dead" ); st->print("Dead" );
break; break;
case OopMapValue::callee_saved_value: case OopMapValue::callee_saved_value:
tty->print("Callers_" ); st->print("Callers_" );
optional->print(); optional->print_on(st);
break; break;
case OopMapValue::derived_oop_value: case OopMapValue::derived_oop_value:
tty->print("Derived_oop_" ); st->print("Derived_oop_" );
optional->print(); optional->print_on(st);
break; break;
case OopMapValue::stack_obj: case OopMapValue::stack_obj:
tty->print("Stack"); st->print("Stack");
break; break;
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
@ -534,11 +534,11 @@ void print_register_type(OopMapValue::oop_types x, VMReg optional) {
} }
void OopMapValue::print() const { void OopMapValue::print_on(outputStream* st) const {
reg()->print(); reg()->print_on(st);
tty->print("="); st->print("=");
print_register_type(type(),content_reg()); print_register_type(type(),content_reg(),st);
tty->print(" "); st->print(" ");
} }

View File

@ -129,7 +129,8 @@ public:
return reg()->reg2stack(); return reg()->reg2stack();
} }
void print( ) const PRODUCT_RETURN; void print_on(outputStream* st) const PRODUCT_RETURN;
void print() const { print_on(tty); }
}; };