src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
Print this page
*** 2589,2614 ****
i += CompactibleFreeListSpace::IndexSetStride) {
_blocks_to_claim[i].modify(n, wt, true /* force */);
}
}
! HeapWord* CFLS_LAB::alloc(size_t word_sz) {
FreeChunk* res;
assert(word_sz == _cfls->adjustObjectSize(word_sz), "Error");
if (word_sz >= CompactibleFreeListSpace::IndexSetSize) {
// This locking manages sync with other large object allocations.
MutexLockerEx x(_cfls->parDictionaryAllocLock(),
Mutex::_no_safepoint_check_flag);
res = _cfls->getChunkFromDictionaryExact(word_sz);
if (res == NULL) return NULL;
} else {
AdaptiveFreeList<FreeChunk>* fl = &_indexedFreeList[word_sz];
if (fl->count() == 0) {
// Attempt to refill this local free list.
get_from_global_pool(word_sz, fl);
// If it didn't work, give up.
if (fl->count() == 0) return NULL;
}
res = fl->get_chunk_at_head();
assert(res != NULL, "Why was count non-zero?");
}
res->markNotFree();
--- 2589,2628 ----
i += CompactibleFreeListSpace::IndexSetStride) {
_blocks_to_claim[i].modify(n, wt, true /* force */);
}
}
! HeapWord* CFLS_LAB::alloc(const ParNewTracer* gc_tracer, size_t word_sz,
! const oop old, const markOop m) {
FreeChunk* res;
assert(word_sz == _cfls->adjustObjectSize(word_sz), "Error");
if (word_sz >= CompactibleFreeListSpace::IndexSetSize) {
// This locking manages sync with other large object allocations.
MutexLockerEx x(_cfls->parDictionaryAllocLock(),
Mutex::_no_safepoint_check_flag);
res = _cfls->getChunkFromDictionaryExact(word_sz);
if (res == NULL) return NULL;
+ if (gc_tracer->should_report_promotion_outside_plab_event()) {
+ uint age = m->has_displaced_mark_helper() ?
+ m->displaced_mark_helper()->age() :
+ m->age();
+ gc_tracer->report_promotion_outside_plab_event(old, word_sz, age, true);
+ }
} else {
AdaptiveFreeList<FreeChunk>* fl = &_indexedFreeList[word_sz];
if (fl->count() == 0) {
// Attempt to refill this local free list.
get_from_global_pool(word_sz, fl);
// If it didn't work, give up.
if (fl->count() == 0) return NULL;
+ if (gc_tracer->should_report_promotion_in_new_plab_event()) {
+ uint age = m->has_displaced_mark_helper() ?
+ m->displaced_mark_helper()->age() :
+ m->age();
+ gc_tracer->report_promotion_in_new_plab_event(old, word_sz, age, true,
+ fl->count() * fl->size());
+ }
}
res = fl->get_chunk_at_head();
assert(res != NULL, "Why was count non-zero?");
}
res->markNotFree();