Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,27 @@ 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)) {
return;
}
oop obj = CompressedOops::decode_not_null(heap_oop);
if (!_heap->is_in_young(obj)) {
// Young object -> old field stores do not require card mark.
return;
}
volatile CardTable::CardValue* byte = card_table()->byte_for(field);
*byte = CardTable::dirty_card_val();
if (UseCondCardMark) {
if (*byte != CardTable::dirty_card_val()) {
*byte = CardTable::dirty_card_val();
}
} else {
*byte = CardTable::dirty_card_val();
}
}

template <typename T>
Expand Down