8284816: Make markWord::has_monitor() more robust

Reviewed-by: stuefe, zgu, dcubed
This commit is contained in:
Roman Kennke 2022-04-14 09:33:37 +00:00
parent 2ba5cc4163
commit 339005dbc9

View File

@ -176,7 +176,7 @@ class markWord {
return (BasicLock*) value();
}
bool has_monitor() const {
return ((value() & monitor_value) != 0);
return ((value() & lock_mask_in_place) == monitor_value);
}
ObjectMonitor* monitor() const {
assert(has_monitor(), "check");