8253183: Fragile memory barrier selection for some weak memory model platforms

Reviewed-by: dholmes, eosterlund, dcubed
This commit is contained in:
Martin Doerr 2020-09-30 09:03:06 +00:00
parent 8331e63fe4
commit dc3a0f5f88
4 changed files with 23 additions and 21 deletions

View file

@ -489,13 +489,10 @@ void ObjectMonitor::install_displaced_markword_in_object(const oop obj) {
// Separate loads in is_being_async_deflated(), which is almost always
// called before this function, from the load of dmw/header below.
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
// A non-multiple copy atomic (nMCA) machine needs a bigger
// hammer to separate the loads before and the load below.
OrderAccess::fence();
} else {
OrderAccess::loadload();
}
// _contentions and dmw/header may get written by different threads.
// Make sure to observe them in the same order when having several observers.
OrderAccess::loadload_for_IRIW();
const oop l_object = object_peek();
if (l_object == NULL) {