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

CompactStrings intrinsics should use ArrayCopyNode

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None

      Description

      LibraryCallKit::inline_string_toBytesU(), LibraryCallKit::inline_string_getCharsU() and PhaseStringOpts::arraycopy() use direct calls to array copy stub. Instead an ArrayCopyNode should be emitted. Currently, this does not work because an ArrayCopyNode requires

        // (2) src and dest arrays must have elements of the same BasicType

      Since for ..toBytesU() and ..getCharsU() we are copying from char[] to byte[] or vice-versa, we cannot use ArrayCopyNode without modifying the macro expansion. The same applies to PhaseStringOpts::arraycopy() where we are copying between two byte arrays because the ArrayCopyNode does not "know" that we can always copy chars since the offsets are guaranteed to be char aligned.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thartmann Tobias Hartmann
                Reporter:
                thartmann Tobias Hartmann
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: