mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8371284: GenShen: Avoid unnecessary card marking
Reviewed-by: wkemper, shade, ysr
This commit is contained in:
parent
6cbfc7691f
commit
8a93658e87
@ -191,6 +191,20 @@ inline void ShenandoahBarrierSet::keep_alive_if_weak(DecoratorSet decorators, oo
|
||||
template <DecoratorSet decorators, typename T>
|
||||
inline void ShenandoahBarrierSet::write_ref_field_post(T* field) {
|
||||
assert(ShenandoahCardBarrier, "Should have been checked by caller");
|
||||
if (_heap->is_in_young(field)) {
|
||||
// Young field stores do not require card mark.
|
||||
return;
|
||||
}
|
||||
T heap_oop = RawAccess<>::oop_load(field);
|
||||
if (CompressedOops::is_null(heap_oop)) {
|
||||
// Null reference store do not require card mark.
|
||||
return;
|
||||
}
|
||||
oop obj = CompressedOops::decode_not_null(heap_oop);
|
||||
if (!_heap->is_in_young(obj)) {
|
||||
// Not an old->young reference store.
|
||||
return;
|
||||
}
|
||||
volatile CardTable::CardValue* byte = card_table()->byte_for(field);
|
||||
*byte = CardTable::dirty_card_val();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user