< prev index next >

src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp

Print this page




  45    _cc(0) {
  46 }
  47 
  48 void G1VerifyOopClosure::print_object(outputStream* out, oop obj) {
  49 #ifdef PRODUCT
  50   Klass* k = obj->klass();
  51   const char* class_name = InstanceKlass::cast(k)->external_name();
  52   out->print_cr("class name %s", class_name);
  53 #else // PRODUCT
  54   obj->print_on(out);
  55 #endif // PRODUCT
  56 }
  57 
  58 template <class T> void G1VerifyOopClosure::do_oop_work(T* p) {
  59   T heap_oop = RawAccess<>::oop_load(p);
  60   if (!CompressedOops::is_null(heap_oop)) {
  61     _cc++;
  62     oop obj = CompressedOops::decode_not_null(heap_oop);
  63     bool failed = false;
  64     if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _verify_option)) {
  65       MutexLockerEx x(ParGCRareEvent_lock,
  66           Mutex::_no_safepoint_check_flag);
  67       LogStreamHandle(Error, gc, verify) yy;
  68       if (!_failures) {
  69         yy.cr();
  70         yy.print_cr("----------");
  71       }
  72       if (!_g1h->is_in_closed_subset(obj)) {
  73         HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
  74         yy.print_cr("Field " PTR_FORMAT
  75             " of live obj " PTR_FORMAT " in region "
  76             "[" PTR_FORMAT ", " PTR_FORMAT ")",
  77             p2i(p), p2i(_containing_obj),
  78             p2i(from->bottom()), p2i(from->end()));
  79         print_object(&yy, _containing_obj);
  80         yy.print_cr("points to obj " PTR_FORMAT " not in the heap",
  81             p2i(obj));
  82       } else {
  83         HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
  84         HeapRegion* to   = _g1h->heap_region_containing((HeapWord*)obj);
  85         yy.print_cr("Field " PTR_FORMAT
  86             " of live obj " PTR_FORMAT " in region "


  45    _cc(0) {
  46 }
  47 
  48 void G1VerifyOopClosure::print_object(outputStream* out, oop obj) {
  49 #ifdef PRODUCT
  50   Klass* k = obj->klass();
  51   const char* class_name = InstanceKlass::cast(k)->external_name();
  52   out->print_cr("class name %s", class_name);
  53 #else // PRODUCT
  54   obj->print_on(out);
  55 #endif // PRODUCT
  56 }
  57 
  58 template <class T> void G1VerifyOopClosure::do_oop_work(T* p) {
  59   T heap_oop = RawAccess<>::oop_load(p);
  60   if (!CompressedOops::is_null(heap_oop)) {
  61     _cc++;
  62     oop obj = CompressedOops::decode_not_null(heap_oop);
  63     bool failed = false;
  64     if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _verify_option)) {
  65       MutexLocker x(ParGCRareEvent_lock);

  66       LogStreamHandle(Error, gc, verify) yy;
  67       if (!_failures) {
  68         yy.cr();
  69         yy.print_cr("----------");
  70       }
  71       if (!_g1h->is_in_closed_subset(obj)) {
  72         HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
  73         yy.print_cr("Field " PTR_FORMAT
  74             " of live obj " PTR_FORMAT " in region "
  75             "[" PTR_FORMAT ", " PTR_FORMAT ")",
  76             p2i(p), p2i(_containing_obj),
  77             p2i(from->bottom()), p2i(from->end()));
  78         print_object(&yy, _containing_obj);
  79         yy.print_cr("points to obj " PTR_FORMAT " not in the heap",
  80             p2i(obj));
  81       } else {
  82         HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
  83         HeapRegion* to   = _g1h->heap_region_containing((HeapWord*)obj);
  84         yy.print_cr("Field " PTR_FORMAT
  85             " of live obj " PTR_FORMAT " in region "
< prev index next >