hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
changeset 30147 af9a41999c6e
parent 29697 92501504191b
child 30152 5fe1c8494b49
equal deleted inserted replaced
29809:c59a5f161524 30147:af9a41999c6e
   671 #define FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(ClosureType)          \
   671 #define FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(ClosureType)          \
   672 void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr,                 \
   672 void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr,                 \
   673                                                  HeapWord* bottom,              \
   673                                                  HeapWord* bottom,              \
   674                                                  HeapWord* top,                 \
   674                                                  HeapWord* top,                 \
   675                                                  ClosureType* cl) {             \
   675                                                  ClosureType* cl) {             \
   676    bool is_par = SharedHeap::heap()->n_par_threads() > 0;                       \
   676    bool is_par = GenCollectedHeap::heap()->n_par_threads() > 0;                 \
   677    if (is_par) {                                                                \
   677    if (is_par) {                                                                \
   678      assert(SharedHeap::heap()->n_par_threads() ==                              \
   678      assert(GenCollectedHeap::heap()->n_par_threads() ==                        \
   679             SharedHeap::heap()->workers()->active_workers(), "Mismatch");       \
   679             GenCollectedHeap::heap()->workers()->active_workers(), "Mismatch"); \
   680      walk_mem_region_with_cl_par(mr, bottom, top, cl);                          \
   680      walk_mem_region_with_cl_par(mr, bottom, top, cl);                          \
   681    } else {                                                                     \
   681    } else {                                                                     \
   682      walk_mem_region_with_cl_nopar(mr, bottom, top, cl);                        \
   682      walk_mem_region_with_cl_nopar(mr, bottom, top, cl);                        \
   683    }                                                                            \
   683    }                                                                            \
   684 }                                                                               \
   684 }                                                                               \
  1905   // adjust block offset table
  1905   // adjust block offset table
  1906   OrderAccess::storestore();
  1906   OrderAccess::storestore();
  1907   assert(chunk->is_free() && ffc->is_free(), "Error");
  1907   assert(chunk->is_free() && ffc->is_free(), "Error");
  1908   _bt.split_block((HeapWord*)chunk, chunk->size(), new_size);
  1908   _bt.split_block((HeapWord*)chunk, chunk->size(), new_size);
  1909   if (rem_sz < SmallForDictionary) {
  1909   if (rem_sz < SmallForDictionary) {
  1910     bool is_par = (SharedHeap::heap()->n_par_threads() > 0);
  1910     bool is_par = (GenCollectedHeap::heap()->n_par_threads() > 0);
  1911     if (is_par) _indexedFreeListParLocks[rem_sz]->lock();
  1911     if (is_par) _indexedFreeListParLocks[rem_sz]->lock();
  1912     assert(!is_par ||
  1912     assert(!is_par ||
  1913            (SharedHeap::heap()->n_par_threads() ==
  1913            (GenCollectedHeap::heap()->n_par_threads() ==
  1914             SharedHeap::heap()->workers()->active_workers()), "Mismatch");
  1914             GenCollectedHeap::heap()->workers()->active_workers()), "Mismatch");
  1915     returnChunkToFreeList(ffc);
  1915     returnChunkToFreeList(ffc);
  1916     split(size, rem_sz);
  1916     split(size, rem_sz);
  1917     if (is_par) _indexedFreeListParLocks[rem_sz]->unlock();
  1917     if (is_par) _indexedFreeListParLocks[rem_sz]->unlock();
  1918   } else {
  1918   } else {
  1919     returnChunkToDictionary(ffc);
  1919     returnChunkToDictionary(ffc);
  1980   _promoInfo.startTrackingPromotions();
  1980   _promoInfo.startTrackingPromotions();
  1981 }
  1981 }
  1982 
  1982 
  1983 bool CompactibleFreeListSpace::no_allocs_since_save_marks() {
  1983 bool CompactibleFreeListSpace::no_allocs_since_save_marks() {
  1984   assert(_promoInfo.tracking(), "No preceding save_marks?");
  1984   assert(_promoInfo.tracking(), "No preceding save_marks?");
  1985   assert(SharedHeap::heap()->n_par_threads() == 0,
  1985   assert(GenCollectedHeap::heap()->n_par_threads() == 0,
  1986          "Shouldn't be called if using parallel gc.");
  1986          "Shouldn't be called if using parallel gc.");
  1987   return _promoInfo.noPromotions();
  1987   return _promoInfo.noPromotions();
  1988 }
  1988 }
  1989 
  1989 
  1990 #define CFLS_OOP_SINCE_SAVE_MARKS_DEFN(OopClosureType, nv_suffix)           \
  1990 #define CFLS_OOP_SINCE_SAVE_MARKS_DEFN(OopClosureType, nv_suffix)           \
  1991                                                                             \
  1991                                                                             \
  1992 void CompactibleFreeListSpace::                                             \
  1992 void CompactibleFreeListSpace::                                             \
  1993 oop_since_save_marks_iterate##nv_suffix(OopClosureType* blk) {              \
  1993 oop_since_save_marks_iterate##nv_suffix(OopClosureType* blk) {              \
  1994   assert(SharedHeap::heap()->n_par_threads() == 0,                          \
  1994   assert(GenCollectedHeap::heap()->n_par_threads() == 0,                    \
  1995          "Shouldn't be called (yet) during parallel part of gc.");          \
  1995          "Shouldn't be called (yet) during parallel part of gc.");          \
  1996   _promoInfo.promoted_oops_iterate##nv_suffix(blk);                         \
  1996   _promoInfo.promoted_oops_iterate##nv_suffix(blk);                         \
  1997   /*                                                                        \
  1997   /*                                                                        \
  1998    * This also restores any displaced headers and removes the elements from \
  1998    * This also restores any displaced headers and removes the elements from \
  1999    * the iteration set as they are processed, so that we have a clean slate \
  1999    * the iteration set as they are processed, so that we have a clean slate \