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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: