8014971: Minor code cleanup of the freelist management

Reviewed-by: jwilhelm, jmasa, tschatzl
This commit is contained in:
Bengt Rutisson 2013-05-22 08:04:58 +02:00
parent b33547e347
commit 0be2f273c7
6 changed files with 1 additions and 29 deletions

View File

@ -50,14 +50,6 @@ AdaptiveFreeList<Chunk>::AdaptiveFreeList() : FreeList<Chunk>(), _hint(0) {
init_statistics(); init_statistics();
} }
template <class Chunk>
AdaptiveFreeList<Chunk>::AdaptiveFreeList(Chunk* fc) : FreeList<Chunk>(fc), _hint(0) {
init_statistics();
#ifndef PRODUCT
_allocation_stats.set_returned_bytes(size() * HeapWordSize);
#endif
}
template <class Chunk> template <class Chunk>
void AdaptiveFreeList<Chunk>::initialize() { void AdaptiveFreeList<Chunk>::initialize() {
FreeList<Chunk>::initialize(); FreeList<Chunk>::initialize();

View File

@ -55,7 +55,6 @@ class AdaptiveFreeList : public FreeList<Chunk> {
public: public:
AdaptiveFreeList(); AdaptiveFreeList();
AdaptiveFreeList(Chunk* fc);
using FreeList<Chunk>::assert_proper_lock_protection; using FreeList<Chunk>::assert_proper_lock_protection;
#ifdef ASSERT #ifdef ASSERT

View File

@ -153,8 +153,6 @@ CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs,
_indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1 _indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1
"a freelist par lock", "a freelist par lock",
true); true);
if (_indexedFreeListParLocks[i] == NULL)
vm_exit_during_initialization("Could not allocate a par lock");
DEBUG_ONLY( DEBUG_ONLY(
_indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]);
) )
@ -1763,7 +1761,7 @@ CompactibleFreeListSpace::addChunkToFreeListsAtEndRecordingStats(
} }
ec->set_size(size); ec->set_size(size);
debug_only(ec->mangleFreed(size)); debug_only(ec->mangleFreed(size));
if (size < SmallForDictionary) { if (size < SmallForDictionary && ParallelGCThreads != 0) {
lock = _indexedFreeListParLocks[size]; lock = _indexedFreeListParLocks[size];
} }
MutexLockerEx x(lock, Mutex::_no_safepoint_check_flag); MutexLockerEx x(lock, Mutex::_no_safepoint_check_flag);

View File

@ -3381,7 +3381,6 @@ bool ConcurrentMarkSweepGeneration::grow_by(size_t bytes) {
assert_locked_or_safepoint(Heap_lock); assert_locked_or_safepoint(Heap_lock);
bool result = _virtual_space.expand_by(bytes); bool result = _virtual_space.expand_by(bytes);
if (result) { if (result) {
HeapWord* old_end = _cmsSpace->end();
size_t new_word_size = size_t new_word_size =
heap_word_size(_virtual_space.committed_size()); heap_word_size(_virtual_space.committed_size());
MemRegion mr(_cmsSpace->bottom(), new_word_size); MemRegion mr(_cmsSpace->bottom(), new_word_size);

View File

@ -54,17 +54,6 @@ FreeList<Chunk>::FreeList() :
_count = 0; _count = 0;
} }
template <class Chunk>
FreeList<Chunk>::FreeList(Chunk* fc) :
_head(fc), _tail(fc)
#ifdef ASSERT
, _protecting_lock(NULL)
#endif
{
_size = fc->size();
_count = 1;
}
template <class Chunk> template <class Chunk>
void FreeList<Chunk>::link_head(Chunk* v) { void FreeList<Chunk>::link_head(Chunk* v) {
assert_proper_lock_protection(); assert_proper_lock_protection();

View File

@ -80,8 +80,6 @@ class FreeList VALUE_OBJ_CLASS_SPEC {
// Constructor // Constructor
// Construct a list without any entries. // Construct a list without any entries.
FreeList(); FreeList();
// Construct a list with "fc" as the first (and lone) entry in the list.
FreeList(Chunk_t* fc);
// Do initialization // Do initialization
void initialize(); void initialize();
@ -177,9 +175,6 @@ class FreeList VALUE_OBJ_CLASS_SPEC {
// found. Return NULL if "fc" is not found. // found. Return NULL if "fc" is not found.
bool verify_chunk_in_free_list(Chunk_t* fc) const; bool verify_chunk_in_free_list(Chunk_t* fc) const;
// Stats verification
// void verify_stats() const { ShouldNotReachHere(); };
// Printing support // Printing support
static void print_labels_on(outputStream* st, const char* c); static void print_labels_on(outputStream* st, const char* c);
void print_on(outputStream* st, const char* c = NULL) const; void print_on(outputStream* st, const char* c = NULL) const;