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

Remove potential re-inflation from FastHashCode under LM_LIGHTWEIGHT

XMLWordPrintable

    • b22

      JDK-8319773 removed the possibility that FastHashCode would inflate an object when trying to install/retrieve a hash code on a fast_locked object.

      However there exists a race when the thread that tries to install the hash code finds an inflated ObjectMonitor, and the deflation thread deflates the ObjectMonitor concurrently causing the FastHashCode logic to re-inflate the ObjectMonitor.

      This can be resolved by simply taking the ObjectMonitor* from the markWord when LM_LIGHTWEIGHT is used and retrying without inflating if it was deflated.

      This enhancement would remove the last code path which can inflate an ObjectMonitor from a non java thread, which in turn could simplify the `is_lock_owned` logic and allow for stronger assertions.

            fbredberg Fredrik Bredberg
            aboldtch Axel Boldt-Christmas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: