RFR: 8325303: Replace markWord.is_neutral() with markWord.is_unlocked()
David Holmes
dholmes at openjdk.org
Fri Apr 5 01:12:13 UTC 2024
On Thu, 4 Apr 2024 08:26:44 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> This is a small tidy up to try and remove confusion between checking `is_neutral` (a general state normally associated with a displaced markword in a "pristine" state) and `is_unlocked` (a specific state within the locking protocol). The underlying bit-pattern is the same and so these have been used somewhat synonymously/interchangeably.
>>
>> A few comment tweaks too.
>>
>> Testing: tiers 1-3 (sanity)
>>
>> Thanks.
>
> This seems reasonable to me. Are there any use-cases of `is_neutral()` left? Could you explain why we use `is_neutral()` there and not `is_locked()`?
Thanks for the reviews @stefank and @dcubed-ojdk .
> Are there any use-cases of is_neutral() left? Could you explain why we use is_neutral() there and not is_locked()?
As Dan indicated (thanks Dan) yes there remain uses of `is_neutral` associated with inspection of the displaced markword. The displaced markword is (mostly) used when the associated object is locked, but the displaced markword itself contains the unlocked bit pattern. So I decided to keep the `is_neutral` terminology in those cases to avoid potential avoid confusion.
As this doesn't seem to be a sticking point I will proceed with integration.
Thanks again.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17741#issuecomment-2038569301
More information about the hotspot-dev
mailing list