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 "
87 "[" PTR_FORMAT ", " PTR_FORMAT ")",
88 p2i(p), p2i(_containing_obj),
89 p2i(from->bottom()), p2i(from->end()));
90 print_object(&yy, _containing_obj);
91 yy.print_cr("points to dead obj " PTR_FORMAT " in region "
92 "[" PTR_FORMAT ", " PTR_FORMAT ")",
93 p2i(obj), p2i(to->bottom()), p2i(to->end()));
94 print_object(&yy, obj);
95 }
96 yy.print_cr("----------");
97 yy.flush();
98 _failures = true;
99 failed = true;
100 }
101 }
102 }
103
104 template void G1VerifyOopClosure::do_oop_work(oop*);
105 template void G1VerifyOopClosure::do_oop_work(narrowOop*);
|
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 " of live obj " PTR_FORMAT " in region " HR_FORMAT,
75 p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
76 print_object(&yy, _containing_obj);
77 yy.print_cr("points to obj " PTR_FORMAT " not in the heap",
78 p2i(obj));
79 } else {
80 HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
81 HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
82 yy.print_cr("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
83 p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
84 print_object(&yy, _containing_obj);
85 yy.print_cr("points to dead obj " PTR_FORMAT " in region " HR_FORMAT,
86 p2i(obj), HR_FORMAT_PARAMS(to));
87 print_object(&yy, obj);
88 }
89 yy.print_cr("----------");
90 yy.flush();
91 _failures = true;
92 failed = true;
93 }
94 }
95 }
96
97 template void G1VerifyOopClosure::do_oop_work(oop*);
98 template void G1VerifyOopClosure::do_oop_work(narrowOop*);
|