-
Enhancement
-
Resolution: Fixed
-
P4
-
15
-
b26
-
generic
-
generic
The following fix is doing a partial cleanup on the
ObjectMonitor::_owner field:
JDK-8236035 refactor ObjectMonitor::set_owner() and _owner field setting
The focus of 8236035 was on the refactoring of set_owner()
and how the _owner field was set. Of course when you partially
cleanup code, folks tend to notice additional things that could
be done to make the code even better.
This RFE is focused on changing loads and stores to the
ObjectMonitor::_owner field to use Atomic::load() and
Atomic::store() along with removing the "volatile" specifier
on the ObjectMonitor::_owner field.
As part of this RFE: we should add:
void* owner_raw() {
Atomic::load(&_owner);
}
probably as an inline function.
There is an existing owner() inline function that returns the owner field value
but it will substitute NULL for DEFLATER_MARKER. So the new owner_raw()
function is for those places that really want the actual value.
Migrating away from C++ volatile semantics is inspired by JDK-8234192.
ObjectMonitor::_owner field:
The focus of 8236035 was on the refactoring of set_owner()
and how the _owner field was set. Of course when you partially
cleanup code, folks tend to notice additional things that could
be done to make the code even better.
This RFE is focused on changing loads and stores to the
ObjectMonitor::_owner field to use Atomic::load() and
Atomic::store() along with removing the "volatile" specifier
on the ObjectMonitor::_owner field.
As part of this RFE: we should add:
void* owner_raw() {
Atomic::load(&_owner);
}
probably as an inline function.
There is an existing owner() inline function that returns the owner field value
but it will substitute NULL for DEFLATER_MARKER. So the new owner_raw()
function is for those places that really want the actual value.
Migrating away from C++ volatile semantics is inspired by JDK-8234192.
- relates to
-
JDK-8267953 restore 'volatile' to ObjectMonitor::_owner field
- Resolved
-
JDK-8236035 refactor ObjectMonitor::set_owner() and _owner field setting
- Resolved
-
JDK-8234192 undefined behavior: C++ volatile keyword
- Open