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

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


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


      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.




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


              • Created: