Currently, markWord::has_monitor() is implemented like this:
return ((value() & monitor_value) != 0);
monitor value is 0b10. This means that it also reports marked or forwarded objects (0b11) as having a monitor, which is wrong. As far as I can tell, it does not cause any problems because relevant code is either not affected by marked/forwarded objects, or by testing bits in an order that hides the problem.
return ((value() & monitor_value) != 0);
monitor value is 0b10. This means that it also reports marked or forwarded objects (0b11) as having a monitor, which is wrong. As far as I can tell, it does not cause any problems because relevant code is either not affected by marked/forwarded objects, or by testing bits in an order that hides the problem.