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

CompactStrings intrinsics should use ArrayCopyNode

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 10
    • 9
    • hotspot
    • None

      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.

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

              Created:
              Updated:
              Resolved: