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

Replace markWord.is_neutral() with markWord.is_unlocked()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 23
    • hotspot
    • b18

      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.

            dholmes David Holmes
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: