CompactStrings intrinsics should use ArrayCopyNode

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • 10
    • Affects Version/s: 9
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: