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

Remove fork to xxcodeArrayLoop() and xxcodeBufferLoop() in sun.nio.cs coders

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • None
    • core-libs
    • None

      Use same code on heap buffers and direct buffers.
      Snippet of current code:
              protected CoderResult decodeLoop(ByteBuffer src,
                                               CharBuffer dst)
              {
                  if (src.hasArray() && dst.hasArray())
                      return decodeArrayLoop(src, dst);
                  else
                      return decodeBufferLoop(src, dst);
              }

      Since access to heap buffers and direct buffers is now optimized via Unsafe [1], there is no more need to separately optimize the code for heap buffers and direct buffers.
      [1] https://bugs.openjdk.java.net/browse/JDK-8149469

            sherman Xueming Shen
            ulfzibis Ulf Zibis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: