# HG changeset patch # User brutisso # Date 1369202698 -7200 # Node ID 7c5a1b62f53d0a90575dc8993addbaff068918c6 # Parent 6702da6b6082eb89d7d5ac238e5923beff124c44 8014971: Minor code cleanup of the freelist management Reviewed-by: jwilhelm, jmasa, tschatzl diff -r 6702da6b6082 -r 7c5a1b62f53d src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp Tue May 21 11:30:14 2013 +0200 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp Wed May 22 08:04:58 2013 +0200 @@ -51,14 +51,6 @@ } template -AdaptiveFreeList::AdaptiveFreeList(Chunk* fc) : FreeList(fc), _hint(0) { - init_statistics(); -#ifndef PRODUCT - _allocation_stats.set_returned_bytes(size() * HeapWordSize); -#endif -} - -template void AdaptiveFreeList::initialize() { FreeList::initialize(); set_hint(0); diff -r 6702da6b6082 -r 7c5a1b62f53d src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp Tue May 21 11:30:14 2013 +0200 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp Wed May 22 08:04:58 2013 +0200 @@ -55,7 +55,6 @@ public: AdaptiveFreeList(); - AdaptiveFreeList(Chunk* fc); using FreeList::assert_proper_lock_protection; #ifdef ASSERT diff -r 6702da6b6082 -r 7c5a1b62f53d src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Tue May 21 11:30:14 2013 +0200 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Wed May 22 08:04:58 2013 +0200 @@ -153,8 +153,6 @@ _indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1 "a freelist par lock", true); - if (_indexedFreeListParLocks[i] == NULL) - vm_exit_during_initialization("Could not allocate a par lock"); DEBUG_ONLY( _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); ) @@ -1763,7 +1761,7 @@ } ec->set_size(size); debug_only(ec->mangleFreed(size)); - if (size < SmallForDictionary) { + if (size < SmallForDictionary && ParallelGCThreads != 0) { lock = _indexedFreeListParLocks[size]; } MutexLockerEx x(lock, Mutex::_no_safepoint_check_flag); diff -r 6702da6b6082 -r 7c5a1b62f53d src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Tue May 21 11:30:14 2013 +0200 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed May 22 08:04:58 2013 +0200 @@ -3381,7 +3381,6 @@ assert_locked_or_safepoint(Heap_lock); bool result = _virtual_space.expand_by(bytes); if (result) { - HeapWord* old_end = _cmsSpace->end(); size_t new_word_size = heap_word_size(_virtual_space.committed_size()); MemRegion mr(_cmsSpace->bottom(), new_word_size); diff -r 6702da6b6082 -r 7c5a1b62f53d src/share/vm/memory/freeList.cpp --- a/src/share/vm/memory/freeList.cpp Tue May 21 11:30:14 2013 +0200 +++ b/src/share/vm/memory/freeList.cpp Wed May 22 08:04:58 2013 +0200 @@ -55,17 +55,6 @@ } template -FreeList::FreeList(Chunk* fc) : - _head(fc), _tail(fc) -#ifdef ASSERT - , _protecting_lock(NULL) -#endif -{ - _size = fc->size(); - _count = 1; -} - -template void FreeList::link_head(Chunk* v) { assert_proper_lock_protection(); set_head(v); diff -r 6702da6b6082 -r 7c5a1b62f53d src/share/vm/memory/freeList.hpp --- a/src/share/vm/memory/freeList.hpp Tue May 21 11:30:14 2013 +0200 +++ b/src/share/vm/memory/freeList.hpp Wed May 22 08:04:58 2013 +0200 @@ -80,8 +80,6 @@ // Constructor // Construct a list without any entries. FreeList(); - // Construct a list with "fc" as the first (and lone) entry in the list. - FreeList(Chunk_t* fc); // Do initialization void initialize(); @@ -177,9 +175,6 @@ // found. Return NULL if "fc" is not found. bool verify_chunk_in_free_list(Chunk_t* fc) const; - // Stats verification -// void verify_stats() const { ShouldNotReachHere(); }; - // Printing support static void print_labels_on(outputStream* st, const char* c); void print_on(outputStream* st, const char* c = NULL) const;