hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp
changeset 33105 294e48b4f704
parent 30764 fec48bf5a827
child 33753 3add06d0880f
equal deleted inserted replaced
33104:a7c0f60a1294 33105:294e48b4f704
    27 
    27 
    28 #include "gc/g1/heapRegionSet.hpp"
    28 #include "gc/g1/heapRegionSet.hpp"
    29 
    29 
    30 inline void HeapRegionSetBase::add(HeapRegion* hr) {
    30 inline void HeapRegionSetBase::add(HeapRegion* hr) {
    31   check_mt_safety();
    31   check_mt_safety();
    32   assert(hr->containing_set() == NULL, hrs_ext_msg(this, "should not already have a containing set %u"));
    32   assert(hr->containing_set() == NULL, "%s", hrs_ext_msg(this, "should not already have a containing set %u").buffer());
    33   assert(hr->next() == NULL, hrs_ext_msg(this, "should not already be linked"));
    33   assert(hr->next() == NULL, "%s", hrs_ext_msg(this, "should not already be linked").buffer());
    34   assert(hr->prev() == NULL, hrs_ext_msg(this, "should not already be linked"));
    34   assert(hr->prev() == NULL, "%s", hrs_ext_msg(this, "should not already be linked").buffer());
    35 
    35 
    36   _count.increment(1u, hr->capacity());
    36   _count.increment(1u, hr->capacity());
    37   hr->set_containing_set(this);
    37   hr->set_containing_set(this);
    38   verify_region(hr);
    38   verify_region(hr);
    39 }
    39 }
    40 
    40 
    41 inline void HeapRegionSetBase::remove(HeapRegion* hr) {
    41 inline void HeapRegionSetBase::remove(HeapRegion* hr) {
    42   check_mt_safety();
    42   check_mt_safety();
    43   verify_region(hr);
    43   verify_region(hr);
    44   assert(hr->next() == NULL, hrs_ext_msg(this, "should already be unlinked"));
    44   assert(hr->next() == NULL, "%s", hrs_ext_msg(this, "should already be unlinked").buffer());
    45   assert(hr->prev() == NULL, hrs_ext_msg(this, "should already be unlinked"));
    45   assert(hr->prev() == NULL, "%s", hrs_ext_msg(this, "should already be unlinked").buffer());
    46 
    46 
    47   hr->set_containing_set(NULL);
    47   hr->set_containing_set(NULL);
    48   assert(_count.length() > 0, hrs_ext_msg(this, "pre-condition"));
    48   assert(_count.length() > 0, "%s", hrs_ext_msg(this, "pre-condition").buffer());
    49   _count.decrement(1u, hr->capacity());
    49   _count.decrement(1u, hr->capacity());
    50 }
    50 }
    51 
    51 
    52 inline void FreeRegionList::add_ordered(HeapRegion* hr) {
    52 inline void FreeRegionList::add_ordered(HeapRegion* hr) {
    53   assert((length() == 0 && _head == NULL && _tail == NULL && _last == NULL) ||
    53   assert((length() == 0 && _head == NULL && _tail == NULL && _last == NULL) ||
    54          (length() >  0 && _head != NULL && _tail != NULL),
    54          (length() >  0 && _head != NULL && _tail != NULL),
    55          hrs_ext_msg(this, "invariant"));
    55          "%s", hrs_ext_msg(this, "invariant").buffer());
    56   // add() will verify the region and check mt safety.
    56   // add() will verify the region and check mt safety.
    57   add(hr);
    57   add(hr);
    58 
    58 
    59   // Now link the region
    59   // Now link the region
    60   if (_head != NULL) {
    60   if (_head != NULL) {
   127 
   127 
   128   if (is_empty()) {
   128   if (is_empty()) {
   129     return NULL;
   129     return NULL;
   130   }
   130   }
   131   assert(length() > 0 && _head != NULL && _tail != NULL,
   131   assert(length() > 0 && _head != NULL && _tail != NULL,
   132          hrs_ext_msg(this, "invariant"));
   132          "%s", hrs_ext_msg(this, "invariant").buffer());
   133 
   133 
   134   HeapRegion* hr;
   134   HeapRegion* hr;
   135 
   135 
   136   if (from_head) {
   136   if (from_head) {
   137     hr = remove_from_head_impl();
   137     hr = remove_from_head_impl();