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
const char *VMRegImpl::regName[ConcreteRegisterImpl::number_of_registers];
void VMRegImpl::print() {
#ifndef PRODUCT
void VMRegImpl::print_on(outputStream* st) const {
if( is_reg() ) {
assert( VMRegImpl::regName[value()], "" );
tty->print("%s",VMRegImpl::regName[value()]);
st->print("%s",VMRegImpl::regName[value()]);
} else if (is_stack()) {
int stk = value() - stack0->value();
tty->print("[%d]", stk*4);
st->print("[%d]", stk*4);
} 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; }
bool is_valid() { return ((intptr_t) this) != BAD; }
bool is_stack() { return (intptr_t) this >= (intptr_t) stack0; }
bool is_reg() { return is_valid() && !is_stack(); }
bool is_valid() const { return ((intptr_t) this) != BAD; }
bool is_stack() const { return (intptr_t) this >= (intptr_t) stack0; }
bool is_reg() const { return is_valid() && !is_stack(); }
// 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
@ -96,7 +96,8 @@ public:
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.
// 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 ) {
case OopMapValue::oop_value:
tty->print("Oop");
st->print("Oop");
break;
case OopMapValue::value_value:
tty->print("Value" );
st->print("Value" );
break;
case OopMapValue::dead_value:
tty->print("Dead" );
st->print("Dead" );
break;
case OopMapValue::callee_saved_value:
tty->print("Callers_" );
optional->print();
st->print("Callers_" );
optional->print_on(st);
break;
case OopMapValue::derived_oop_value:
tty->print("Derived_oop_" );
optional->print();
st->print("Derived_oop_" );
optional->print_on(st);
break;
case OopMapValue::stack_obj:
tty->print("Stack");
st->print("Stack");
break;
default:
ShouldNotReachHere();
@ -534,11 +534,11 @@ void print_register_type(OopMapValue::oop_types x, VMReg optional) {
}
void OopMapValue::print() const {
reg()->print();
tty->print("=");
print_register_type(type(),content_reg());
tty->print(" ");
void OopMapValue::print_on(outputStream* st) const {
reg()->print_on(st);
st->print("=");
print_register_type(type(),content_reg(),st);
st->print(" ");
}

View File

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