< prev index next >
src/hotspot/share/runtime/synchronizer.cpp
Print this page
rev 59856 : 8247280: more fencing needed in async deflation for non-TSO machines
Reviewed-by: dholmes
@@ -1906,11 +1906,12 @@
object->release_set_mark(markWord::encode(m));
// Once ObjectMonitor is configured and the object is associated
// with the ObjectMonitor, it is safe to allow async deflation:
assert(m->is_new(), "freshly allocated monitor must be new");
- m->set_allocation_state(ObjectMonitor::Old);
+ // Release semantics needed to keep allocation_state from floating up.
+ m->release_set_allocation_state(ObjectMonitor::Old);
// Hopefully the performance counters are allocated on distinct cache lines
// to avoid false sharing on MP systems ...
OM_PERFDATA_OP(Inflations, inc());
if (log_is_enabled(Trace, monitorinflation)) {
@@ -1963,10 +1964,12 @@
}
// Once the ObjectMonitor is configured and object is associated
// with the ObjectMonitor, it is safe to allow async deflation:
assert(m->is_new(), "freshly allocated monitor must be new");
+ // Release semantics are not needed to keep allocation_state from
+ // floating up since cas_set_mark() takes care of it.
m->set_allocation_state(ObjectMonitor::Old);
// Hopefully the performance counters are allocated on distinct
// cache lines to avoid false sharing on MP systems ...
OM_PERFDATA_OP(Inflations, inc());
< prev index next >