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

All oop stores in the x64 interpreter are treated as volatile when using G1

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 10, 11
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64

      Description

      In the x64 interpreter, the rdx register is always used as a temporary register for GC write barriers when using G1. However, code performing heap oop stores first load whether the field is volatile through the field flags into rdx, then performs the heap store (clobbering rdx in the G1 post-write barrier that loads the effective address of the field into rdx). Then after the heap oop store, we check if we need to perform a StoreLoad fence if the field was volatile, based on the contents of rdx. However, rdx has now been clobbered, and this check will at the moment always be true, and perform StoreLoad fence on every heap oop store. If the temp register in the GC backend was to do anything different, this could swing the other way and break the JMM in very subtle ways.

        Attachments

          Activity

            People

            • Assignee:
              coleenp Coleen Phillimore
              Reporter:
              eosterlund Erik Ă–sterlund
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: