--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-08-22 15:27:32.040109035 -0700 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-08-22 15:27:31.948109038 -0700 @@ -4480,31 +4480,40 @@ } HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose, - size_t word_size) { + size_t word_size, + oop const old, + uint age) { + + HeapWord* result = NULL; + if (purpose == GCAllocForSurvived) { - HeapWord* result = survivor_attempt_allocation(word_size); + result = survivor_attempt_allocation(word_size); if (result != NULL) { - return result; + _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. - return old_attempt_allocation(word_size); + 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"); - HeapWord* result = old_attempt_allocation(word_size); + result = old_attempt_allocation(word_size); if (result != NULL) { - return result; + _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. - return survivor_attempt_allocation(word_size); + result = survivor_attempt_allocation(word_size); + if (result != NULL) { + _g1h->_gc_tracer_stw->report_promotion_to_new_plab(old, age, false, word_size); + } } } - ShouldNotReachHere(); - // Trying to keep some compilers happy. - return NULL; + return result; } G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) :