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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P3
    • None
    • Affects Version/s: None
    • Component/s: 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

            Assignee:
            Xueming Shen
            Reporter:
            Ulf Zibis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: