src/share/vm/gc_implementation/g1/g1Allocator.cpp

Print this page

        

*** 26,35 **** --- 26,36 ---- #include "gc_implementation/g1/g1Allocator.hpp" #include "gc_implementation/g1/g1CollectedHeap.hpp" #include "gc_implementation/g1/g1CollectorPolicy.hpp" #include "gc_implementation/g1/heapRegion.inline.hpp" #include "gc_implementation/g1/heapRegionSet.inline.hpp" + #include "gc_implementation/shared/gcTrace.hpp" void G1DefaultAllocator::init_mutator_alloc_region() { assert(_mutator_alloc_region.get() == NULL, "pre-condition"); _mutator_alloc_region.init(); }
*** 108,118 **** } G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) : ParGCAllocBuffer(gclab_word_size), _retired(true) { } ! HeapWord* G1ParGCAllocator::allocate_slow(GCAllocPurpose purpose, size_t word_sz, AllocationContext_t context) { HeapWord* obj = NULL; size_t gclab_word_size = _g1h->desired_plab_sz(purpose); if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) { G1ParGCAllocBuffer* alloc_buf = alloc_buffer(purpose, context); add_to_alloc_buffer_waste(alloc_buf->words_remaining()); --- 109,121 ---- } G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) : ParGCAllocBuffer(gclab_word_size), _retired(true) { } ! HeapWord* G1ParGCAllocator::allocate_slow(GCAllocPurpose purpose, size_t word_sz, ! const oop old, const uint age, ! AllocationContext_t context) { HeapWord* obj = NULL; size_t gclab_word_size = _g1h->desired_plab_sz(purpose); if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) { G1ParGCAllocBuffer* alloc_buf = alloc_buffer(purpose, context); add_to_alloc_buffer_waste(alloc_buf->words_remaining());
*** 126,137 **** --- 129,152 ---- alloc_buf->set_word_size(gclab_word_size); alloc_buf->set_buf(buf); obj = alloc_buf->allocate(word_sz); assert(obj != NULL, "buffer was definitely big enough..."); + if (_g1h->_gc_tracer_stw->should_report_promotion_in_new_plab_event()) { + bool tenured = _g1h->heap_region_containing_raw(obj)->is_old(); + _g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old, word_sz, + age, tenured, + gclab_word_size); + } } else { obj = _g1h->par_allocate_during_gc(purpose, word_sz, context); + if (obj != NULL + && _g1h->_gc_tracer_stw->should_report_promotion_outside_plab_event()) { + bool tenured = _g1h->heap_region_containing_raw(obj)->is_old(); + _g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old, word_sz, + age, tenured); + } } return obj; } G1DefaultParGCAllocator::G1DefaultParGCAllocator(G1CollectedHeap* g1h) :