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

migrate ObjectMonitor::_owner field away from C++ volatile semantics

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 15
    • 16
    • hotspot
    • b26
    • generic
    • generic

    Description

      The following fix is doing a partial cleanup on the
      ObjectMonitor::_owner field:

           JDK-8236035 refactor ObjectMonitor::set_owner() and _owner field setting

      The focus of 8236035 was on the refactoring of set_owner()
      and how the _owner field was set. Of course when you partially
      cleanup code, folks tend to notice additional things that could
      be done to make the code even better.

      This RFE is focused on changing loads and stores to the
      ObjectMonitor::_owner field to use Atomic::load() and
      Atomic::store() along with removing the "volatile" specifier
      on the ObjectMonitor::_owner field.

      As part of this RFE: we should add:

        void* owner_raw() {
          Atomic::load(&_owner);
        }

      probably as an inline function.

      There is an existing owner() inline function that returns the owner field value
      but it will substitute NULL for DEFLATER_MARKER. So the new owner_raw()
      function is for those places that really want the actual value.

      Migrating away from C++ volatile semantics is inspired by JDK-8234192.

      Attachments

        Issue Links

          Activity

            People

              dcubed Daniel Daugherty
              dcubed Daniel Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: