mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8066443: Add G1 support for promotion event
Reviewed-by: tschatzl
This commit is contained in:
parent
dada9bc32c
commit
96823ab211
4 changed files with 29 additions and 0 deletions
|
@ -186,6 +186,21 @@ InCSetState G1ParScanThreadState::next_state(InCSetState const state, markOop co
|
||||||
return dest(state);
|
return dest(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void G1ParScanThreadState::report_promotion_event(InCSetState const dest_state,
|
||||||
|
oop const old, size_t word_sz, uint age,
|
||||||
|
HeapWord * const obj_ptr,
|
||||||
|
const AllocationContext_t context) const {
|
||||||
|
G1PLAB* alloc_buf = _plab_allocator->alloc_buffer(dest_state, context);
|
||||||
|
if (alloc_buf->contains(obj_ptr)) {
|
||||||
|
_g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old->klass(), word_sz, age,
|
||||||
|
dest_state.value() == InCSetState::Old,
|
||||||
|
alloc_buf->word_sz());
|
||||||
|
} else {
|
||||||
|
_g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old->klass(), word_sz, age,
|
||||||
|
dest_state.value() == InCSetState::Old);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
oop G1ParScanThreadState::copy_to_survivor_space(InCSetState const state,
|
oop G1ParScanThreadState::copy_to_survivor_space(InCSetState const state,
|
||||||
oop const old,
|
oop const old,
|
||||||
markOop const old_mark) {
|
markOop const old_mark) {
|
||||||
|
@ -219,6 +234,10 @@ oop G1ParScanThreadState::copy_to_survivor_space(InCSetState const state,
|
||||||
return handle_evacuation_failure_par(old, old_mark);
|
return handle_evacuation_failure_par(old, old_mark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_g1h->_gc_tracer_stw->should_report_promotion_events()) {
|
||||||
|
// The events are checked individually as part of the actual commit
|
||||||
|
report_promotion_event(dest_state, old, word_sz, age, obj_ptr, context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(obj_ptr != NULL, "when we get here, allocation should have succeeded");
|
assert(obj_ptr != NULL, "when we get here, allocation should have succeeded");
|
||||||
|
|
|
@ -173,6 +173,10 @@ class G1ParScanThreadState : public CHeapObj<mtGC> {
|
||||||
bool previous_plab_refill_failed);
|
bool previous_plab_refill_failed);
|
||||||
|
|
||||||
inline InCSetState next_state(InCSetState const state, markOop const m, uint& age);
|
inline InCSetState next_state(InCSetState const state, markOop const m, uint& age);
|
||||||
|
|
||||||
|
void report_promotion_event(InCSetState const dest_state,
|
||||||
|
oop const old, size_t word_sz, uint age,
|
||||||
|
HeapWord * const obj_ptr, const AllocationContext_t context) const;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
oop copy_to_survivor_space(InCSetState const state, oop const obj, markOop const old_mark);
|
oop copy_to_survivor_space(InCSetState const state, oop const obj, markOop const old_mark);
|
||||||
|
|
|
@ -173,6 +173,11 @@ void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
|
||||||
_tenuring_threshold = tenuring_threshold;
|
_tenuring_threshold = tenuring_threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool YoungGCTracer::should_report_promotion_events() const {
|
||||||
|
return should_report_promotion_in_new_plab_event() ||
|
||||||
|
should_report_promotion_outside_plab_event();
|
||||||
|
}
|
||||||
|
|
||||||
bool YoungGCTracer::should_report_promotion_in_new_plab_event() const {
|
bool YoungGCTracer::should_report_promotion_in_new_plab_event() const {
|
||||||
return should_send_promotion_in_new_plab_event();
|
return should_send_promotion_in_new_plab_event();
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,7 @@ class YoungGCTracer : public GCTracer {
|
||||||
*
|
*
|
||||||
* plab_size is the size of the newly allocated PLAB in bytes.
|
* plab_size is the size of the newly allocated PLAB in bytes.
|
||||||
*/
|
*/
|
||||||
|
bool should_report_promotion_events() const;
|
||||||
bool should_report_promotion_in_new_plab_event() const;
|
bool should_report_promotion_in_new_plab_event() const;
|
||||||
bool should_report_promotion_outside_plab_event() const;
|
bool should_report_promotion_outside_plab_event() const;
|
||||||
void report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
|
void report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue