hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
changeset 23471 ec9427262f0a
parent 23463 8a9ab140068a
child 23505 b3c5e757bbb7
equal deleted inserted replaced
23470:ff2a7ea4225d 23471:ec9427262f0a
  1927           HeapRegion* hr = iter.get_next();
  1927           HeapRegion* hr = iter.get_next();
  1928           hr_printer->cleanup(hr);
  1928           hr_printer->cleanup(hr);
  1929         }
  1929         }
  1930       }
  1930       }
  1931 
  1931 
  1932       _cleanup_list->add_as_tail(&local_cleanup_list);
  1932       _cleanup_list->add_ordered(&local_cleanup_list);
  1933       assert(local_cleanup_list.is_empty(), "post-condition");
  1933       assert(local_cleanup_list.is_empty(), "post-condition");
  1934 
  1934 
  1935       HeapRegionRemSet::finish_cleanup_task(&hrrs_cleanup_task);
  1935       HeapRegionRemSet::finish_cleanup_task(&hrrs_cleanup_task);
  1936     }
  1936     }
  1937   }
  1937   }
  2156 
  2156 
  2157   // Noone else should be accessing the _cleanup_list at this point,
  2157   // Noone else should be accessing the _cleanup_list at this point,
  2158   // so it's not necessary to take any locks
  2158   // so it's not necessary to take any locks
  2159   while (!_cleanup_list.is_empty()) {
  2159   while (!_cleanup_list.is_empty()) {
  2160     HeapRegion* hr = _cleanup_list.remove_head();
  2160     HeapRegion* hr = _cleanup_list.remove_head();
  2161     assert(hr != NULL, "the list was not empty");
  2161     assert(hr != NULL, "Got NULL from a non-empty list");
  2162     hr->par_clear();
  2162     hr->par_clear();
  2163     tmp_free_list.add_as_tail(hr);
  2163     tmp_free_list.add_ordered(hr);
  2164 
  2164 
  2165     // Instead of adding one region at a time to the secondary_free_list,
  2165     // Instead of adding one region at a time to the secondary_free_list,
  2166     // we accumulate them in the local list and move them a few at a
  2166     // we accumulate them in the local list and move them a few at a
  2167     // time. This also cuts down on the number of notify_all() calls
  2167     // time. This also cuts down on the number of notify_all() calls
  2168     // we do during this process. We'll also append the local list when
  2168     // we do during this process. We'll also append the local list when
  2178                                _cleanup_list.length());
  2178                                _cleanup_list.length());
  2179       }
  2179       }
  2180 
  2180 
  2181       {
  2181       {
  2182         MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag);
  2182         MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag);
  2183         g1h->secondary_free_list_add_as_tail(&tmp_free_list);
  2183         g1h->secondary_free_list_add(&tmp_free_list);
  2184         SecondaryFreeList_lock->notify_all();
  2184         SecondaryFreeList_lock->notify_all();
  2185       }
  2185       }
  2186 
  2186 
  2187       if (G1StressConcRegionFreeing) {
  2187       if (G1StressConcRegionFreeing) {
  2188         for (uintx i = 0; i < G1StressConcRegionFreeingDelayMillis; ++i) {
  2188         for (uintx i = 0; i < G1StressConcRegionFreeingDelayMillis; ++i) {