151 if (CollectedHeap::use_parallel_gc_threads()) { |
151 if (CollectedHeap::use_parallel_gc_threads()) { |
152 for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { |
152 for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { |
153 _indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1 |
153 _indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1 |
154 "a freelist par lock", |
154 "a freelist par lock", |
155 true); |
155 true); |
156 if (_indexedFreeListParLocks[i] == NULL) |
|
157 vm_exit_during_initialization("Could not allocate a par lock"); |
|
158 DEBUG_ONLY( |
156 DEBUG_ONLY( |
159 _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); |
157 _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); |
160 ) |
158 ) |
161 } |
159 } |
162 _dictionary->set_par_lock(&_parDictionaryAllocLock); |
160 _dictionary->set_par_lock(&_parDictionaryAllocLock); |
1761 ec = (FreeChunk*)chunk; |
1759 ec = (FreeChunk*)chunk; |
1762 } |
1760 } |
1763 } |
1761 } |
1764 ec->set_size(size); |
1762 ec->set_size(size); |
1765 debug_only(ec->mangleFreed(size)); |
1763 debug_only(ec->mangleFreed(size)); |
1766 if (size < SmallForDictionary) { |
1764 if (size < SmallForDictionary && ParallelGCThreads != 0) { |
1767 lock = _indexedFreeListParLocks[size]; |
1765 lock = _indexedFreeListParLocks[size]; |
1768 } |
1766 } |
1769 MutexLockerEx x(lock, Mutex::_no_safepoint_check_flag); |
1767 MutexLockerEx x(lock, Mutex::_no_safepoint_check_flag); |
1770 addChunkAndRepairOffsetTable((HeapWord*)ec, size, true); |
1768 addChunkAndRepairOffsetTable((HeapWord*)ec, size, true); |
1771 // record the birth under the lock since the recording involves |
1769 // record the birth under the lock since the recording involves |