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

Elimination of trivial initializing field store barriers doesn't always happen

    XMLWordPrintable

    Details

      Description

      The attached benchmark creates slices with both memory segments and byte buffers. When running the benchmark with this option:

      -XX:CompileCommand=print,java/nio/HeapIntBuffer.slice -XX:CompileCommand=print,java/nio/DirectIntBufferU.slice -XX:CompileCommand=print,jdk/internal/foreign/AbstractMemorySegmentImpl.asSlice

      Some memory barriers show up, of the kind:

        0x00007f76a4f83109: lock addl $0x0,-0x40(%rsp)

      These barriers seem to be extremely sensitive to how fields are stored (see JDK-8279930), and they cause performance issues when said code is later inline into other methods.

      Running with a GC other than G1 (e.g. -XX:+UseSerialGC) removes these barriers.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vlivanov Vladimir Ivanov
              Reporter:
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: