src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Print this page
*** 4478,4512 ****
_preserved_marks_of_objs.push(m);
}
}
HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose,
! size_t word_size) {
if (purpose == GCAllocForSurvived) {
! HeapWord* result = survivor_attempt_allocation(word_size);
if (result != NULL) {
! return result;
} else {
// Let's try to allocate in the old gen in case we can fit the
// object there.
! return old_attempt_allocation(word_size);
}
} else {
assert(purpose == GCAllocForTenured, "sanity");
! HeapWord* result = old_attempt_allocation(word_size);
if (result != NULL) {
! return result;
} else {
// Let's try to allocate in the survivors in case we can fit the
// object there.
! return survivor_attempt_allocation(word_size);
}
}
! ShouldNotReachHere();
! // Trying to keep some compilers happy.
! return NULL;
}
G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) :
ParGCAllocBuffer(gclab_word_size), _retired(true) { }
--- 4478,4521 ----
_preserved_marks_of_objs.push(m);
}
}
HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose,
! size_t word_size,
! oop const old,
! uint age) {
!
! HeapWord* result = NULL;
!
if (purpose == GCAllocForSurvived) {
! result = survivor_attempt_allocation(word_size);
if (result != NULL) {
! _g1h->_gc_tracer_stw->report_promotion_to_new_plab(old, age, false, word_size);
} else {
// Let's try to allocate in the old gen in case we can fit the
// object there.
! result = old_attempt_allocation(word_size);
! if (result != NULL) {
! _g1h->_gc_tracer_stw->report_promotion_to_new_plab(old, age, true, word_size);
! }
}
} else {
assert(purpose == GCAllocForTenured, "sanity");
! result = old_attempt_allocation(word_size);
if (result != NULL) {
! _g1h->_gc_tracer_stw->report_promotion_to_new_plab(old, age, true, word_size);
} else {
// Let's try to allocate in the survivors in case we can fit the
// object there.
! result = survivor_attempt_allocation(word_size);
! if (result != NULL) {
! _g1h->_gc_tracer_stw->report_promotion_to_new_plab(old, age, false, word_size);
! }
}
}
! return result;
}
G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) :
ParGCAllocBuffer(gclab_word_size), _retired(true) { }