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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 12
    • 10, 11
    • hotspot
    • None
    • b13
    • 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

        Issue Links

          Activity

            People

              coleenp Coleen Phillimore
              eosterlund Erik Ă–sterlund
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: