equal
deleted
inserted
replaced
184 } |
184 } |
185 } |
185 } |
186 return dest(state); |
186 return dest(state); |
187 } |
187 } |
188 |
188 |
|
189 void G1ParScanThreadState::report_promotion_event(InCSetState const dest_state, |
|
190 oop const old, size_t word_sz, uint age, |
|
191 HeapWord * const obj_ptr, |
|
192 const AllocationContext_t context) const { |
|
193 G1PLAB* alloc_buf = _plab_allocator->alloc_buffer(dest_state, context); |
|
194 if (alloc_buf->contains(obj_ptr)) { |
|
195 _g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old->klass(), word_sz, age, |
|
196 dest_state.value() == InCSetState::Old, |
|
197 alloc_buf->word_sz()); |
|
198 } else { |
|
199 _g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old->klass(), word_sz, age, |
|
200 dest_state.value() == InCSetState::Old); |
|
201 } |
|
202 } |
|
203 |
189 oop G1ParScanThreadState::copy_to_survivor_space(InCSetState const state, |
204 oop G1ParScanThreadState::copy_to_survivor_space(InCSetState const state, |
190 oop const old, |
205 oop const old, |
191 markOop const old_mark) { |
206 markOop const old_mark) { |
192 const size_t word_sz = old->size(); |
207 const size_t word_sz = old->size(); |
193 HeapRegion* const from_region = _g1h->heap_region_containing_raw(old); |
208 HeapRegion* const from_region = _g1h->heap_region_containing_raw(old); |
216 if (obj_ptr == NULL) { |
231 if (obj_ptr == NULL) { |
217 // This will either forward-to-self, or detect that someone else has |
232 // This will either forward-to-self, or detect that someone else has |
218 // installed a forwarding pointer. |
233 // installed a forwarding pointer. |
219 return handle_evacuation_failure_par(old, old_mark); |
234 return handle_evacuation_failure_par(old, old_mark); |
220 } |
235 } |
|
236 } |
|
237 if (_g1h->_gc_tracer_stw->should_report_promotion_events()) { |
|
238 // The events are checked individually as part of the actual commit |
|
239 report_promotion_event(dest_state, old, word_sz, age, obj_ptr, context); |
221 } |
240 } |
222 } |
241 } |
223 |
242 |
224 assert(obj_ptr != NULL, "when we get here, allocation should have succeeded"); |
243 assert(obj_ptr != NULL, "when we get here, allocation should have succeeded"); |
225 assert(_g1h->is_in_reserved(obj_ptr), "Allocated memory should be in the heap"); |
244 assert(_g1h->is_in_reserved(obj_ptr), "Allocated memory should be in the heap"); |