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

PPC64: ObjectMonitor::_owner should be reset unconditionally in nmethod unlocking

XMLWordPrintable

    • b20
    • ppc
    • generic

      The ObjectMonitor::_owner check in MacroAssembler::compiler_fast_unlock_object() [1] is redundant and should be removed because java code with unbalanced locking is never compiled to nmethods.

      ObjectMonitor::_owner can be a stack address with LM_LEGACY [3]. In that case the result of the check is wrong. Execution will take unnecessarily the slow path.

      [1] Redundant check: https://github.com/openjdk/jdk/blob/20f36c666c30e50c446d09cca4ea52395317a7eb/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp#L2700-L2705

      [2] ciMethod::has_balanced_monitors() https://github.com/openjdk/jdk/blob/7a1e832ea997f9984eb5fc18474a8f1650ddb1bf/src/hotspot/share/ci/ciMethod.cpp#L290

      [3] _owner can be a stack address: https://github.com/openjdk/jdk/blob/a601cd2e100958e3f37ae65e32e4b3cac246c079/src/hotspot/share/runtime/synchronizer.cpp#L1530

            rrich Richard Reingruber
            rrich Richard Reingruber
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: