(bf) Intrinsify ByteBuffer.put{Int,Double,Float,...} methods

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • b64

        I think the issue can also be solved with VM intrinsics, but it seems simpler to do it with s.m.Unsafe. Current code for non-byte ByteBuffer calls all the way down to Bits, which does:

            static void putIntB(ByteBuffer bb, int bi, int x) {
                bb._put(bi , int3(x));
                bb._put(bi + 1, int2(x));
                bb._put(bi + 2, int1(x));
                bb._put(bi + 3, int0(x));
            }

        The compiler is known to produce distinct writes in these cases. It is beneficial to replace byte-wide stores into the full-width stores. The caveats include: misaligned reads/writes, handling endianness, etc.

              Assignee:
              Andrew Haley
              Reporter:
              Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: