< prev index next >
src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
Print this page
rev 7184 : 6979279
rev 7185 : [mq]: rev1
rev 7186 : [mq]: rev2
*** 147,168 ****
_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.
--- 147,165 ----
*** 620,640 ****
// 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.
--- 617,631 ----
*** 1738,1751 ****
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;
! }
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) {
--- 1729,1739 ----
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 = &_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,1768 ****
ec = (FreeChunk*)chunk;
}
}
ec->set_size(size);
debug_only(ec->mangleFreed(size));
! if (size < SmallForDictionary && ParallelGCThreads != 0) {
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
--- 1746,1756 ----
ec = (FreeChunk*)chunk;
}
}
ec->set_size(size);
debug_only(ec->mangleFreed(size));
! 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 next >