Details
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.
// (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
- duplicates
-
JDK-8146547 String copy intrinsics should zero array in case of tightly coupled allocation
-
- Open
-
- relates to
-
JDK-8054307 JEP 254: Compact Strings
-
- Closed
-