mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8357954: G1: No SATB barriers applied for runtime IN_NATIVE atomics
Reviewed-by: shade, kbarrett, tschatzl
This commit is contained in:
parent
4618374269
commit
d3f54dae30
@ -112,6 +112,11 @@ class G1BarrierSet: public CardTableBarrierSet {
|
||||
// Defensive: will catch weak oops at addresses in heap
|
||||
template <typename T>
|
||||
static oop oop_load_in_heap(T* addr);
|
||||
|
||||
template <typename T>
|
||||
static oop oop_atomic_cmpxchg_not_in_heap(T* addr, oop compare_value, oop new_value);
|
||||
template <typename T>
|
||||
static oop oop_atomic_xchg_not_in_heap(T* addr, oop new_value);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -132,4 +132,26 @@ oop_store_not_in_heap(T* addr, oop new_value) {
|
||||
Raw::oop_store(addr, new_value);
|
||||
}
|
||||
|
||||
template <DecoratorSet decorators, typename BarrierSetT>
|
||||
template <typename T>
|
||||
inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
|
||||
oop_atomic_cmpxchg_not_in_heap(T* addr, oop compare_value, oop new_value) {
|
||||
// Apply SATB barriers for all non-heap references, to allow
|
||||
// concurrent scanning of such references.
|
||||
G1BarrierSet *bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
|
||||
bs->write_ref_field_pre<decorators>(addr);
|
||||
return Raw::oop_atomic_cmpxchg(addr, compare_value, new_value);
|
||||
}
|
||||
|
||||
template <DecoratorSet decorators, typename BarrierSetT>
|
||||
template <typename T>
|
||||
inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
|
||||
oop_atomic_xchg_not_in_heap(T* addr, oop new_value) {
|
||||
// Apply SATB barriers for all non-heap references, to allow
|
||||
// concurrent scanning of such references.
|
||||
G1BarrierSet *bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
|
||||
bs->write_ref_field_pre<decorators>(addr);
|
||||
return Raw::oop_atomic_xchg(addr, new_value);
|
||||
}
|
||||
|
||||
#endif // SHARE_GC_G1_G1BARRIERSET_INLINE_HPP
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user