< prev index next >

src/hotspot/share/oops/oop.cpp

Print this page
*** 37,11 ***
  #include "runtime/thread.inline.hpp"
  #include "utilities/copy.hpp"
  #include "utilities/macros.hpp"
  
  void oopDesc::print_on(outputStream* st) const {
!   klass()->oop_print_on(const_cast<oopDesc*>(this), st);
  }
  
  void oopDesc::print_address_on(outputStream* st) const {
    st->print("{" INTPTR_FORMAT "}", p2i(this));
  
--- 37,19 ---
  #include "runtime/thread.inline.hpp"
  #include "utilities/copy.hpp"
  #include "utilities/macros.hpp"
  
  void oopDesc::print_on(outputStream* st) const {
!   if (this == NULL) {
+     st->print_cr("NULL");
+   } else if (*((juint*)this) == badHeapWordVal) {
+     st->print("BAD WORD");
+   } else if (*((juint*)this) == badMetaWordVal) {
+     st->print("BAD META WORD");
+   } else {
+     klass()->oop_print_on(cast_to_oop(this), st);
+   }
  }
  
  void oopDesc::print_address_on(outputStream* st) const {
    st->print("{" INTPTR_FORMAT "}", p2i(this));
  

*** 67,16 ***
    print_value_on(&st);
    return st.as_string();
  }
  
  void oopDesc::print_value_on(outputStream* st) const {
!   oop obj = const_cast<oopDesc*>(this);
!   if (java_lang_String::is_instance(obj)) {
-     java_lang_String::print(obj, st);
-     print_address_on(st);
    } else {
!     klass()->oop_print_value_on(obj, st);
    }
  }
  
  
  void oopDesc::verify_on(outputStream* st, oopDesc* oop_desc) {
--- 75,20 ---
    print_value_on(&st);
    return st.as_string();
  }
  
  void oopDesc::print_value_on(outputStream* st) const {
!   if (this == NULL) {
!     st->print("NULL");
    } else {
!     oop obj = cast_to_oop(this);
+     if (java_lang_String::is_instance(obj)) {
+       java_lang_String::print(obj, st);
+       print_address_on(st);
+     } else {
+       klass()->oop_print_value_on(obj, st);
+     }
    }
  }
  
  
  void oopDesc::verify_on(outputStream* st, oopDesc* oop_desc) {

*** 136,10 ***
--- 148,11 ---
  // type test operations that doesn't require inclusion of oop.inline.hpp.
  bool oopDesc::is_instance_noinline()          const { return is_instance();            }
  bool oopDesc::is_array_noinline()             const { return is_array();               }
  bool oopDesc::is_objArray_noinline()          const { return is_objArray();            }
  bool oopDesc::is_typeArray_noinline()         const { return is_typeArray();           }
+ bool oopDesc::is_stackChunk_noinline()        const { return is_stackChunk();          }
  
  bool oopDesc::has_klass_gap() {
    // Only has a klass gap when compressed class pointers are used.
    return UseCompressedClassPointers;
  }

*** 221,8 ***
    assert(!Universe::heap()->is_archived_object(forwardee) && !Universe::heap()->is_archived_object(this),
           "forwarding archive object");
  #endif
  }
  
! bool oopDesc::get_UseParallelGC() { return UseParallelGC; }
! bool oopDesc::get_UseG1GC()       { return UseG1GC;       }
  #endif
--- 234,14 ---
    assert(!Universe::heap()->is_archived_object(forwardee) && !Universe::heap()->is_archived_object(this),
           "forwarding archive object");
  #endif
  }
  
! bool oopDesc::size_might_change() {
!   // UseParallelGC and UseG1GC can change the length field
+   // of an "old copy" of an object array in the young gen so it indicates
+   // the grey portion of an already copied array. This will cause the first
+   // disjunct below to fail if the two comparands are computed across such
+   // a concurrent change.
+   return Universe::heap()->is_gc_active() && is_objArray() && is_forwarded() && (UseParallelGC || UseG1GC);
+ }
  #endif
< prev index next >