Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8284816

Make markWord::has_monitor() more robust

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 19
    • hotspot
    • None
    • b19
    • generic
    • generic

      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.

            rkennke Roman Kennke
            rkennke Roman Kennke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: