< prev index next >

src/share/vm/gc_implementation/g1/heapRegionSet.cpp

Print this page
rev 7793 : 8073315: Enable gcc -Wtype-limits and fix upcoming issues.


  40 #ifndef PRODUCT
  41 void HeapRegionSetBase::verify_region(HeapRegion* hr) {
  42   assert(hr->containing_set() == this, err_msg("Inconsistent containing set for %u", hr->hrm_index()));
  43   assert(!hr->is_young(), err_msg("Adding young region %u", hr->hrm_index())); // currently we don't use these sets for young regions
  44   assert(hr->is_humongous() == regions_humongous(), err_msg("Wrong humongous state for region %u and set %s", hr->hrm_index(), name()));
  45   assert(hr->is_free() == regions_free(), err_msg("Wrong free state for region %u and set %s", hr->hrm_index(), name()));
  46   assert(!hr->is_free() || hr->is_empty(), err_msg("Free region %u is not empty for set %s", hr->hrm_index(), name()));
  47   assert(!hr->is_empty() || hr->is_free(), err_msg("Empty region %u is not free for set %s", hr->hrm_index(), name()));
  48   assert(hr->rem_set()->verify_ready_for_par_iteration(), err_msg("Wrong iteration state %u", hr->hrm_index()));
  49 }
  50 #endif
  51 
  52 void HeapRegionSetBase::verify() {
  53   // It's important that we also observe the MT safety protocol even
  54   // for the verification calls. If we do verification without the
  55   // appropriate locks and the set changes underneath our feet
  56   // verification might fail and send us on a wild goose chase.
  57   check_mt_safety();
  58 
  59   guarantee(( is_empty() && length() == 0 && total_capacity_bytes() == 0) ||
  60             (!is_empty() && length() >= 0 && total_capacity_bytes() >= 0),
  61             hrs_ext_msg(this, "invariant"));
  62 }
  63 
  64 void HeapRegionSetBase::verify_start() {
  65   // See comment in verify() about MT safety and verification.
  66   check_mt_safety();
  67   assert(!_verify_in_progress,
  68          hrs_ext_msg(this, "verification should not be in progress"));
  69 
  70   // Do the basic verification first before we do the checks over the regions.
  71   HeapRegionSetBase::verify();
  72 
  73   _verify_in_progress = true;
  74 }
  75 
  76 void HeapRegionSetBase::verify_end() {
  77   // See comment in verify() about MT safety and verification.
  78   check_mt_safety();
  79   assert(_verify_in_progress,
  80          hrs_ext_msg(this, "verification should be in progress"));




  40 #ifndef PRODUCT
  41 void HeapRegionSetBase::verify_region(HeapRegion* hr) {
  42   assert(hr->containing_set() == this, err_msg("Inconsistent containing set for %u", hr->hrm_index()));
  43   assert(!hr->is_young(), err_msg("Adding young region %u", hr->hrm_index())); // currently we don't use these sets for young regions
  44   assert(hr->is_humongous() == regions_humongous(), err_msg("Wrong humongous state for region %u and set %s", hr->hrm_index(), name()));
  45   assert(hr->is_free() == regions_free(), err_msg("Wrong free state for region %u and set %s", hr->hrm_index(), name()));
  46   assert(!hr->is_free() || hr->is_empty(), err_msg("Free region %u is not empty for set %s", hr->hrm_index(), name()));
  47   assert(!hr->is_empty() || hr->is_free(), err_msg("Empty region %u is not free for set %s", hr->hrm_index(), name()));
  48   assert(hr->rem_set()->verify_ready_for_par_iteration(), err_msg("Wrong iteration state %u", hr->hrm_index()));
  49 }
  50 #endif
  51 
  52 void HeapRegionSetBase::verify() {
  53   // It's important that we also observe the MT safety protocol even
  54   // for the verification calls. If we do verification without the
  55   // appropriate locks and the set changes underneath our feet
  56   // verification might fail and send us on a wild goose chase.
  57   check_mt_safety();
  58 
  59   guarantee(( is_empty() && length() == 0 && total_capacity_bytes() == 0) ||
  60             (!is_empty()),
  61             hrs_ext_msg(this, "invariant"));
  62 }
  63 
  64 void HeapRegionSetBase::verify_start() {
  65   // See comment in verify() about MT safety and verification.
  66   check_mt_safety();
  67   assert(!_verify_in_progress,
  68          hrs_ext_msg(this, "verification should not be in progress"));
  69 
  70   // Do the basic verification first before we do the checks over the regions.
  71   HeapRegionSetBase::verify();
  72 
  73   _verify_in_progress = true;
  74 }
  75 
  76 void HeapRegionSetBase::verify_end() {
  77   // See comment in verify() about MT safety and verification.
  78   check_mt_safety();
  79   assert(_verify_in_progress,
  80          hrs_ext_msg(this, "verification should be in progress"));


< prev index next >