hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
changeset 5694 1e0532a6abff
parent 5434 a2e785749780
child 5702 201c5cde25bb
equal deleted inserted replaced
5693:3015c564fcbc 5694:1e0532a6abff
    29 //// CompactibleFreeListSpace
    29 //// CompactibleFreeListSpace
    30 /////////////////////////////////////////////////////////////////////////
    30 /////////////////////////////////////////////////////////////////////////
    31 
    31 
    32 // highest ranked  free list lock rank
    32 // highest ranked  free list lock rank
    33 int CompactibleFreeListSpace::_lockRank = Mutex::leaf + 3;
    33 int CompactibleFreeListSpace::_lockRank = Mutex::leaf + 3;
       
    34 
       
    35 // Defaults are 0 so things will break badly if incorrectly initialized.
       
    36 int CompactibleFreeListSpace::IndexSetStart  = 0;
       
    37 int CompactibleFreeListSpace::IndexSetStride = 0;
       
    38 
       
    39 size_t MinChunkSize = 0;
       
    40 
       
    41 void CompactibleFreeListSpace::set_cms_values() {
       
    42   // Set CMS global values
       
    43   assert(MinChunkSize == 0, "already set");
       
    44   #define numQuanta(x,y) ((x+y-1)/y)
       
    45   MinChunkSize = numQuanta(sizeof(FreeChunk), MinObjAlignmentInBytes) * MinObjAlignment;
       
    46 
       
    47   assert(IndexSetStart == 0 && IndexSetStride == 0, "already set");
       
    48   IndexSetStart  = MinObjAlignment;
       
    49   IndexSetStride = MinObjAlignment;
       
    50 }
    34 
    51 
    35 // Constructor
    52 // Constructor
    36 CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs,
    53 CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs,
    37   MemRegion mr, bool use_adaptive_freelists,
    54   MemRegion mr, bool use_adaptive_freelists,
    38   FreeBlockDictionary::DictionaryChoice dictionaryChoice) :
    55   FreeBlockDictionary::DictionaryChoice dictionaryChoice) :
   300   return sum;
   317   return sum;
   301 }
   318 }
   302 
   319 
   303 size_t CompactibleFreeListSpace::totalCountInIndexedFreeLists() const {
   320 size_t CompactibleFreeListSpace::totalCountInIndexedFreeLists() const {
   304   size_t count = 0;
   321   size_t count = 0;
   305   for (int i = MinChunkSize; i < IndexSetSize; i++) {
   322   for (int i = (int)MinChunkSize; i < IndexSetSize; i++) {
   306     debug_only(
   323     debug_only(
   307       ssize_t total_list_count = 0;
   324       ssize_t total_list_count = 0;
   308       for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL;
   325       for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL;
   309          fc = fc->next()) {
   326          fc = fc->next()) {
   310         total_list_count++;
   327         total_list_count++;