In markword.hpp the definitions for is_neutral() and is_unlocked() are identical and always have been:
bool is_unlocked() const {
return (mask_bits(value(), lock_mask_in_place) == unlocked_value);
}
bool is_neutral() const {
return (mask_bits(value(), lock_mask_in_place) == unlocked_value);
}
Investigating this historical anomaly it seems in the early days of biased-locking, when different approaches were being trialed, the use of is_neutral slipped in via a merge and the anomaly was never noticed, or subsequently cleaned up. With a lot of work happening in this area of the code recently this anomaly has been causing some confusion, so it is prudent to clean things up and just replace is_neutral with is_unlocked where appropriate.
bool is_unlocked() const {
return (mask_bits(value(), lock_mask_in_place) == unlocked_value);
}
bool is_neutral() const {
return (mask_bits(value(), lock_mask_in_place) == unlocked_value);
}
Investigating this historical anomaly it seems in the early days of biased-locking, when different approaches were being trialed, the use of is_neutral slipped in via a merge and the anomaly was never noticed, or subsequently cleaned up. With a lot of work happening in this area of the code recently this anomaly has been causing some confusion, so it is prudent to clean things up and just replace is_neutral with is_unlocked where appropriate.
- relates to
-
JDK-8329898 Revert one use of markWord.is_unlocked back to is_neutral
-
- Resolved
-
-
JDK-8329720 Gtest failure printing markword after JDK-8325303
-
- Closed
-