mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-15 18:33:41 +00:00
8350905: Shenandoah: Releasing a WeakHandle's referent may extend its lifetime
Reviewed-by: shade, ysr
This commit is contained in:
parent
5502ce733e
commit
a347ecdedc
@ -152,10 +152,19 @@ inline void ShenandoahBarrierSet::enqueue(oop obj) {
|
||||
|
||||
template <DecoratorSet decorators, typename T>
|
||||
inline void ShenandoahBarrierSet::satb_barrier(T *field) {
|
||||
// Uninitialized and no-keepalive stores do not need barrier.
|
||||
if (HasDecorator<decorators, IS_DEST_UNINITIALIZED>::value ||
|
||||
HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Stores to weak/phantom require no barrier. The original references would
|
||||
// have been enqueued in the SATB buffer by the load barrier if they were needed.
|
||||
if (HasDecorator<decorators, ON_WEAK_OOP_REF>::value ||
|
||||
HasDecorator<decorators, ON_PHANTOM_OOP_REF>::value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ShenandoahSATBBarrier && _heap->is_concurrent_mark_in_progress()) {
|
||||
T heap_oop = RawAccess<>::oop_load(field);
|
||||
if (!CompressedOops::is_null(heap_oop)) {
|
||||
@ -260,6 +269,7 @@ inline void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_st
|
||||
template <DecoratorSet decorators, typename BarrierSetT>
|
||||
template <typename T>
|
||||
inline void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_store_not_in_heap(T* addr, oop value) {
|
||||
assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
|
||||
oop_store_common(addr, value);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user