RFR: 8284816: Make markWord::has_monitor() more robust

Daniel D.Daugherty dcubed at openjdk.java.net
Wed Apr 13 15:15:26 UTC 2022


On Wed, 13 Apr 2022 14:58:57 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> src/hotspot/share/oops/markWord.hpp line 179:
>> 
>>> 177:   }
>>> 178:   bool has_monitor() const {
>>> 179:     return ((value() & lock_mask_in_place) == monitor_value);
>> 
>> So I'm a bit confused:
>> 
>> src/hotspot/share/oops/markWord.hpp:
>> 
>> `static const uintptr_t monitor_value            = 2;`
>> 
>> In the bug report you say:
>>> monitor value is 0b10
>> 
>> but that not what I'm seeing. What am I missing?
>
> Binary (0b) 10 == decimal 2 ;-)

Sorry, I read that as 0xb10.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8219


More information about the hotspot-dev mailing list