8245233: ZGC: Load volatile oops using Atomic::load()

Reviewed-by: stefank, kbarrett, smonteith
This commit is contained in:
Per Lidén 2020-05-19 08:34:13 +02:00
parent 080b3b83eb
commit cc3a8595a4
2 changed files with 8 additions and 8 deletions

View File

@ -228,7 +228,7 @@ inline oop ZBarrier::load_barrier_on_oop(oop o) {
}
inline oop ZBarrier::load_barrier_on_oop_field(volatile oop* p) {
const oop o = *p;
const oop o = Atomic::load(p);
return load_barrier_on_oop_field_preloaded(p, o);
}
@ -282,7 +282,7 @@ inline void ZBarrier::load_barrier_on_root_oop_field(oop* p) {
//
inline oop ZBarrier::weak_load_barrier_on_oop_field(volatile oop* p) {
assert(!ZResurrection::is_blocked(), "Should not be called during resurrection blocked phase");
const oop o = *p;
const oop o = Atomic::load(p);
return weak_load_barrier_on_oop_field_preloaded(p, o);
}
@ -295,7 +295,7 @@ inline oop ZBarrier::weak_load_barrier_on_weak_oop(oop o) {
}
inline oop ZBarrier::weak_load_barrier_on_weak_oop_field(volatile oop* p) {
const oop o = *p;
const oop o = Atomic::load(p);
return weak_load_barrier_on_weak_oop_field_preloaded(p, o);
}
@ -314,7 +314,7 @@ inline oop ZBarrier::weak_load_barrier_on_phantom_oop(oop o) {
}
inline oop ZBarrier::weak_load_barrier_on_phantom_oop_field(volatile oop* p) {
const oop o = *p;
const oop o = Atomic::load(p);
return weak_load_barrier_on_phantom_oop_field_preloaded(p, o);
}
@ -349,14 +349,14 @@ inline bool ZBarrier::is_alive_barrier_on_phantom_oop(oop o) {
inline void ZBarrier::keep_alive_barrier_on_weak_oop_field(volatile oop* p) {
// This operation is only valid when resurrection is blocked.
assert(ZResurrection::is_blocked(), "Invalid phase");
const oop o = *p;
const oop o = Atomic::load(p);
barrier<is_good_or_null_fast_path, keep_alive_barrier_on_weak_oop_slow_path>(p, o);
}
inline void ZBarrier::keep_alive_barrier_on_phantom_oop_field(volatile oop* p) {
// This operation is only valid when resurrection is blocked.
assert(ZResurrection::is_blocked(), "Invalid phase");
const oop o = *p;
const oop o = Atomic::load(p);
barrier<is_good_or_null_fast_path, keep_alive_barrier_on_phantom_oop_slow_path>(p, o);
}
@ -380,7 +380,7 @@ inline void ZBarrier::keep_alive_barrier_on_oop(oop o) {
// Mark barrier
//
inline void ZBarrier::mark_barrier_on_oop_field(volatile oop* p, bool finalizable) {
const oop o = *p;
const oop o = Atomic::load(p);
if (finalizable) {
barrier<is_marked_or_null_fast_path, mark_barrier_on_finalizable_oop_slow_path>(p, o);

View File

@ -70,7 +70,7 @@ static volatile oop* reference_referent_addr(oop reference) {
}
static oop reference_referent(oop reference) {
return *reference_referent_addr(reference);
return Atomic::load(reference_referent_addr(reference));
}
static void reference_set_referent(oop reference, oop referent) {