8272654: Mark word accesses should not use Access API

Reviewed-by: stefank, rkennke, eosterlund
This commit is contained in:
Aleksey Shipilev 2021-08-20 07:34:41 +00:00
parent 4bd37c3153
commit a81e5e9353

View File

@ -45,13 +45,11 @@
// We need a separate file to avoid circular references
markWord oopDesc::mark() const {
uintptr_t v = HeapAccess<MO_RELAXED>::load_at(as_oop(), mark_offset_in_bytes());
return markWord(v);
return Atomic::load(&_mark);
}
markWord oopDesc::mark_acquire() const {
uintptr_t v = HeapAccess<MO_ACQUIRE>::load_at(as_oop(), mark_offset_in_bytes());
return markWord(v);
return Atomic::load_acquire(&_mark);
}
markWord* oopDesc::mark_addr() const {
@ -59,7 +57,7 @@ markWord* oopDesc::mark_addr() const {
}
void oopDesc::set_mark(markWord m) {
HeapAccess<MO_RELAXED>::store_at(as_oop(), mark_offset_in_bytes(), m.value());
Atomic::store(&_mark, m);
}
void oopDesc::set_mark(HeapWord* mem, markWord m) {
@ -67,12 +65,11 @@ void oopDesc::set_mark(HeapWord* mem, markWord m) {
}
void oopDesc::release_set_mark(markWord m) {
HeapAccess<MO_RELEASE>::store_at(as_oop(), mark_offset_in_bytes(), m.value());
Atomic::release_store(&_mark, m);
}
markWord oopDesc::cas_set_mark(markWord new_mark, markWord old_mark) {
uintptr_t v = HeapAccess<>::atomic_cmpxchg_at(as_oop(), mark_offset_in_bytes(), old_mark.value(), new_mark.value());
return markWord(v);
return Atomic::cmpxchg(&_mark, old_mark, new_mark);
}
markWord oopDesc::cas_set_mark(markWord new_mark, markWord old_mark, atomic_memory_order order) {