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

XMLWordPrintable

      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.

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

              Created:
              Updated: