< prev index

src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp

Print this page
rev 7184 : 6979279
rev 7185 : [mq]: rev1
rev 7186 : [mq]: rev2

@@ -147,22 +147,19 @@
     _fitStrategy = FreeBlockStrategyNone;
   }
   check_free_list_consistency();
 
   // Initialize locks for parallel case.
-
-  if (CollectedHeap::use_parallel_gc_threads()) {
     for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) {
       _indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1
                                               "a freelist par lock",
                                               true);
       DEBUG_ONLY(
         _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]);
       )
     }
     _dictionary->set_par_lock(&_parDictionaryAllocLock);
-  }
 }
 
 // Like CompactibleSpace forward() but always calls cross_threshold() to
 // update the block offset table.  Removed initialize_threshold call because
 // CFLS does not use a block offset array for contiguous spaces.

@@ -620,21 +617,15 @@
       // XXX This is REALLY UGLY and should be fixed up. XXX
       if (!_adaptive_freelists && _smallLinearAllocBlock._ptr == NULL) {
         // Mark the boundary of the new block in BOT
         _bt.mark_block(prevEnd, value);
         // put it all in the linAB
-        if (ParallelGCThreads == 0) {
-          _smallLinearAllocBlock._ptr = prevEnd;
-          _smallLinearAllocBlock._word_size = newFcSize;
-          repairLinearAllocBlock(&_smallLinearAllocBlock);
-        } else { // ParallelGCThreads > 0
           MutexLockerEx x(parDictionaryAllocLock(),
                           Mutex::_no_safepoint_check_flag);
           _smallLinearAllocBlock._ptr = prevEnd;
           _smallLinearAllocBlock._word_size = newFcSize;
           repairLinearAllocBlock(&_smallLinearAllocBlock);
-        }
         // Births of chunks put into a LinAB are not recorded.  Births
         // of chunks as they are allocated out of a LinAB are.
       } else {
         // Add the block to the free lists, if possible coalescing it
         // with the last free block, and update the BOT and census data.

@@ -1738,14 +1729,11 @@
   HeapWord* chunk, size_t     size) {
   // check that the chunk does lie in this space!
   assert(chunk != NULL && is_in_reserved(chunk), "Not in this space!");
   // One of the parallel gc task threads may be here
   // whilst others are allocating.
-  Mutex* lock = NULL;
-  if (ParallelGCThreads != 0) {
-    lock = &_parDictionaryAllocLock;
-  }
+  Mutex* lock = &_parDictionaryAllocLock;
   FreeChunk* ec;
   {
     MutexLockerEx x(lock, Mutex::_no_safepoint_check_flag);
     ec = dictionary()->find_largest_dict();  // get largest block
     if (ec != NULL && ec->end() == (uintptr_t*) chunk) {

@@ -1758,11 +1746,11 @@
       ec = (FreeChunk*)chunk;
     }
   }
   ec->set_size(size);
   debug_only(ec->mangleFreed(size));
-  if (size < SmallForDictionary && ParallelGCThreads != 0) {
+  if (size < SmallForDictionary) {
     lock = _indexedFreeListParLocks[size];
   }
   MutexLockerEx x(lock, Mutex::_no_safepoint_check_flag);
   addChunkAndRepairOffsetTable((HeapWord*)ec, size, true);
   // record the birth under the lock since the recording involves
< prev index