< prev index next >

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

Print this page
rev 54087 : imported patch 8218668-reorganize-collection-set


 354 
 355 class VerifyRegionClosure: public HeapRegionClosure {
 356 private:
 357   bool             _par;
 358   VerifyOption     _vo;
 359   bool             _failures;
 360 public:
 361   // _vo == UsePrevMarking -> use "prev" marking information,
 362   // _vo == UseNextMarking -> use "next" marking information,
 363   // _vo == UseFullMarking -> use "next" marking bitmap but no TAMS
 364   VerifyRegionClosure(bool par, VerifyOption vo)
 365     : _par(par),
 366       _vo(vo),
 367       _failures(false) {}
 368 
 369   bool failures() {
 370     return _failures;
 371   }
 372 
 373   bool do_heap_region(HeapRegion* r) {

 374     guarantee(!r->is_young() || r->rem_set()->is_complete(), "Remembered set for Young region %u must be complete, is %s", r->hrm_index(), r->rem_set()->get_state_str());
 375     // Humongous and old regions regions might be of any state, so can't check here.
 376     guarantee(!r->is_free() || !r->rem_set()->is_tracked(), "Remembered set for free region %u must be untracked, is %s", r->hrm_index(), r->rem_set()->get_state_str());
 377     // Verify that the continues humongous regions' remembered set state matches the
 378     // one from the starts humongous region.
 379     if (r->is_continues_humongous()) {
 380       if (r->rem_set()->get_state_str() != r->humongous_start_region()->rem_set()->get_state_str()) {
 381          log_error(gc, verify)("Remset states differ: Region %u (%s) remset %s with starts region %u (%s) remset %s",
 382                                r->hrm_index(),
 383                                r->get_short_type_str(),
 384                                r->rem_set()->get_state_str(),
 385                                r->humongous_start_region()->hrm_index(),
 386                                r->humongous_start_region()->get_short_type_str(),
 387                                r->humongous_start_region()->rem_set()->get_state_str());
 388          _failures = true;
 389       }
 390     }
 391     // For archive regions, verify there are no heap pointers to
 392     // non-pinned regions. For all others, verify liveness info.
 393     if (r->is_closed_archive()) {




 354 
 355 class VerifyRegionClosure: public HeapRegionClosure {
 356 private:
 357   bool             _par;
 358   VerifyOption     _vo;
 359   bool             _failures;
 360 public:
 361   // _vo == UsePrevMarking -> use "prev" marking information,
 362   // _vo == UseNextMarking -> use "next" marking information,
 363   // _vo == UseFullMarking -> use "next" marking bitmap but no TAMS
 364   VerifyRegionClosure(bool par, VerifyOption vo)
 365     : _par(par),
 366       _vo(vo),
 367       _failures(false) {}
 368 
 369   bool failures() {
 370     return _failures;
 371   }
 372 
 373   bool do_heap_region(HeapRegion* r) {
 374     guarantee(!r->has_index_in_opt_cset(), "Region %u still has opt collection set index %u", r->hrm_index(), r->index_in_opt_cset());
 375     guarantee(!r->is_young() || r->rem_set()->is_complete(), "Remembered set for Young region %u must be complete, is %s", r->hrm_index(), r->rem_set()->get_state_str());
 376     // Humongous and old regions regions might be of any state, so can't check here.
 377     guarantee(!r->is_free() || !r->rem_set()->is_tracked(), "Remembered set for free region %u must be untracked, is %s", r->hrm_index(), r->rem_set()->get_state_str());
 378     // Verify that the continues humongous regions' remembered set state matches the
 379     // one from the starts humongous region.
 380     if (r->is_continues_humongous()) {
 381       if (r->rem_set()->get_state_str() != r->humongous_start_region()->rem_set()->get_state_str()) {
 382          log_error(gc, verify)("Remset states differ: Region %u (%s) remset %s with starts region %u (%s) remset %s",
 383                                r->hrm_index(),
 384                                r->get_short_type_str(),
 385                                r->rem_set()->get_state_str(),
 386                                r->humongous_start_region()->hrm_index(),
 387                                r->humongous_start_region()->get_short_type_str(),
 388                                r->humongous_start_region()->rem_set()->get_state_str());
 389          _failures = true;
 390       }
 391     }
 392     // For archive regions, verify there are no heap pointers to
 393     // non-pinned regions. For all others, verify liveness info.
 394     if (r->is_closed_archive()) {


< prev index next >