6621094: PrintOptoAssembly is broken for oops information in DebugInfo

Wed, 20 Feb 2008 17:23:43 -0800

author
kvn
date
Wed, 20 Feb 2008 17:23:43 -0800
changeset 460
c5cbd367e4d1
parent 459
953939ef62ab
child 461
0871d5cd64cd

6621094: PrintOptoAssembly is broken for oops information in DebugInfo
Summary: OopMapValue and VMRegImpl classes miss the virtual method print_on(st).
Reviewed-by: rasbold, jrose, never

src/share/vm/code/vmreg.cpp file | annotate | diff | comparison | revisions
src/share/vm/code/vmreg.hpp file | annotate | diff | comparison | revisions
src/share/vm/compiler/oopMap.cpp file | annotate | diff | comparison | revisions
src/share/vm/compiler/oopMap.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/code/vmreg.cpp	Wed Feb 20 16:19:43 2008 -0800
     1.2 +++ b/src/share/vm/code/vmreg.cpp	Wed Feb 20 17:23:43 2008 -0800
     1.3 @@ -36,16 +36,16 @@
     1.4  // Register names
     1.5  const char *VMRegImpl::regName[ConcreteRegisterImpl::number_of_registers];
     1.6  
     1.7 -void VMRegImpl::print() {
     1.8  #ifndef PRODUCT
     1.9 +void VMRegImpl::print_on(outputStream* st) const {
    1.10    if( is_reg() ) {
    1.11      assert( VMRegImpl::regName[value()], "" );
    1.12 -    tty->print("%s",VMRegImpl::regName[value()]);
    1.13 +    st->print("%s",VMRegImpl::regName[value()]);
    1.14    } else if (is_stack()) {
    1.15      int stk = value() - stack0->value();
    1.16 -    tty->print("[%d]", stk*4);
    1.17 +    st->print("[%d]", stk*4);
    1.18    } else {
    1.19 -    tty->print("BAD!");
    1.20 +    st->print("BAD!");
    1.21    }
    1.22 +}
    1.23  #endif // PRODUCT
    1.24 -}
     2.1 --- a/src/share/vm/code/vmreg.hpp	Wed Feb 20 16:19:43 2008 -0800
     2.2 +++ b/src/share/vm/code/vmreg.hpp	Wed Feb 20 17:23:43 2008 -0800
     2.3 @@ -66,9 +66,9 @@
     2.4      }
     2.5    }
     2.6    static VMReg Bad() { return (VMReg) (intptr_t) BAD; }
     2.7 -  bool is_valid() { return ((intptr_t) this) != BAD; }
     2.8 -  bool is_stack() { return (intptr_t) this >= (intptr_t) stack0; }
     2.9 -  bool is_reg() { return is_valid() && !is_stack(); }
    2.10 +  bool is_valid() const { return ((intptr_t) this) != BAD; }
    2.11 +  bool is_stack() const { return (intptr_t) this >= (intptr_t) stack0; }
    2.12 +  bool is_reg()   const { return is_valid() && !is_stack(); }
    2.13  
    2.14    // A concrete register is a value that returns true for is_reg() and is
    2.15    // also a register you could use in the assembler. On machines with
    2.16 @@ -96,7 +96,8 @@
    2.17  
    2.18    intptr_t value() const         {return (intptr_t) this; }
    2.19  
    2.20 -  void print();
    2.21 +  void print_on(outputStream* st) const PRODUCT_RETURN;
    2.22 +  void print() const { print_on(tty); }
    2.23  
    2.24    // bias a stack slot.
    2.25    // Typically used to adjust a virtual frame slots by amounts that are offset by
     3.1 --- a/src/share/vm/compiler/oopMap.cpp	Wed Feb 20 16:19:43 2008 -0800
     3.2 +++ b/src/share/vm/compiler/oopMap.cpp	Wed Feb 20 17:23:43 2008 -0800
     3.3 @@ -506,27 +506,27 @@
     3.4  }
     3.5  
     3.6  
     3.7 -void print_register_type(OopMapValue::oop_types x, VMReg optional) {
     3.8 +static void print_register_type(OopMapValue::oop_types x, VMReg optional, outputStream* st) {
     3.9    switch( x ) {
    3.10    case OopMapValue::oop_value:
    3.11 -    tty->print("Oop");
    3.12 +    st->print("Oop");
    3.13      break;
    3.14    case OopMapValue::value_value:
    3.15 -    tty->print("Value" );
    3.16 +    st->print("Value" );
    3.17      break;
    3.18    case OopMapValue::dead_value:
    3.19 -    tty->print("Dead" );
    3.20 +    st->print("Dead" );
    3.21      break;
    3.22    case OopMapValue::callee_saved_value:
    3.23 -    tty->print("Callers_" );
    3.24 -    optional->print();
    3.25 +    st->print("Callers_" );
    3.26 +    optional->print_on(st);
    3.27      break;
    3.28    case OopMapValue::derived_oop_value:
    3.29 -    tty->print("Derived_oop_" );
    3.30 -    optional->print();
    3.31 +    st->print("Derived_oop_" );
    3.32 +    optional->print_on(st);
    3.33      break;
    3.34    case OopMapValue::stack_obj:
    3.35 -    tty->print("Stack");
    3.36 +    st->print("Stack");
    3.37      break;
    3.38    default:
    3.39      ShouldNotReachHere();
    3.40 @@ -534,11 +534,11 @@
    3.41  }
    3.42  
    3.43  
    3.44 -void OopMapValue::print() const {
    3.45 -  reg()->print();
    3.46 -  tty->print("=");
    3.47 -  print_register_type(type(),content_reg());
    3.48 -  tty->print(" ");
    3.49 +void OopMapValue::print_on(outputStream* st) const {
    3.50 +  reg()->print_on(st);
    3.51 +  st->print("=");
    3.52 +  print_register_type(type(),content_reg(),st);
    3.53 +  st->print(" ");
    3.54  }
    3.55  
    3.56  
     4.1 --- a/src/share/vm/compiler/oopMap.hpp	Wed Feb 20 16:19:43 2008 -0800
     4.2 +++ b/src/share/vm/compiler/oopMap.hpp	Wed Feb 20 17:23:43 2008 -0800
     4.3 @@ -129,7 +129,8 @@
     4.4      return reg()->reg2stack();
     4.5    }
     4.6  
     4.7 -  void print( ) const PRODUCT_RETURN;
     4.8 +  void print_on(outputStream* st) const PRODUCT_RETURN;
     4.9 +  void print() const { print_on(tty); }
    4.10  };
    4.11  
    4.12  

mercurial