< prev index next >

src/share/vm/gc/g1/g1HeapVerifier.cpp

Print this page

        

*** 58,69 **** template <class T> void do_oop_nv(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); ! HeapRegion* hr = _g1h->heap_region_containing(obj); ! if (_g1h->is_obj_dead_cond(obj, _vo) && !hr->is_archive()) { Log(gc, verify) log; log.info("Root location " PTR_FORMAT " points to dead obj " PTR_FORMAT, p2i(p), p2i(obj)); if (_vo == VerifyOption_G1UseMarkWord) { log.error(" Mark word: " PTR_FORMAT, p2i(obj->mark())); } --- 58,68 ---- template <class T> void do_oop_nv(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); ! if (_g1h->is_obj_dead_cond(obj, _vo)) { Log(gc, verify) log; log.info("Root location " PTR_FORMAT " points to dead obj " PTR_FORMAT, p2i(p), p2i(obj)); if (_vo == VerifyOption_G1UseMarkWord) { log.error(" Mark word: " PTR_FORMAT, p2i(obj->mark())); }
*** 234,257 **** size_t live_bytes() { return _live_bytes; } }; class VerifyArchiveOopClosure: public OopClosure { HeapRegion* _hr; - bool _verbose; public: ! VerifyArchiveOopClosure(HeapRegion *hr, bool verbose) ! : _hr(hr), _verbose(verbose) { } void do_oop(narrowOop *p) { do_oop_work(p); } void do_oop( oop *p) { do_oop_work(p); } template <class T> void do_oop_work(T *p) { oop obj = oopDesc::load_decode_heap_oop(p); - if (_verbose) { - if (obj != NULL) { - obj->print(); - } - } if (_hr->is_open_archive()) { guarantee(obj == NULL || G1ArchiveAllocator::is_archive_object(obj), "Archive object at " PTR_FORMAT " references a non-archive object at " PTR_FORMAT, p2i(p), p2i(obj)); --- 233,250 ---- size_t live_bytes() { return _live_bytes; } }; class VerifyArchiveOopClosure: public OopClosure { HeapRegion* _hr; public: ! VerifyArchiveOopClosure(HeapRegion *hr) ! : _hr(hr) { } void do_oop(narrowOop *p) { do_oop_work(p); } void do_oop( oop *p) { do_oop_work(p); } template <class T> void do_oop_work(T *p) { oop obj = oopDesc::load_decode_heap_oop(p); if (_hr->is_open_archive()) { guarantee(obj == NULL || G1ArchiveAllocator::is_archive_object(obj), "Archive object at " PTR_FORMAT " references a non-archive object at " PTR_FORMAT, p2i(p), p2i(obj));
*** 264,284 **** } }; class VerifyObjectInArchiveRegionClosure: public ObjectClosure { HeapRegion* _hr; - bool _verbose; public: VerifyObjectInArchiveRegionClosure(HeapRegion *hr, bool verbose) ! : _hr(hr), _verbose(verbose) { } // Verify that all object pointers are to archive regions. void do_object(oop o) { ! if (_verbose) { ! o->print(); ! } ! ! VerifyArchiveOopClosure checkOop(_hr, _verbose); assert(o != NULL, "Should not be here for NULL oops"); o->oop_iterate_no_header(&checkOop); } }; --- 257,272 ---- } }; class VerifyObjectInArchiveRegionClosure: public ObjectClosure { HeapRegion* _hr; public: VerifyObjectInArchiveRegionClosure(HeapRegion *hr, bool verbose) ! : _hr(hr) { } // Verify that all object pointers are to archive regions. void do_object(oop o) { ! VerifyArchiveOopClosure checkOop(_hr); assert(o != NULL, "Should not be here for NULL oops"); o->oop_iterate_no_header(&checkOop); } };
< prev index next >