Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-13 Thread Roger Riggs
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-13 Thread Amit Kumar
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-13 Thread Andrey Turbanov
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-10 Thread Martin Doerr
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-10 Thread Raffaello Giulietti
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-10 Thread Roger Riggs
On Fri, 10 Nov 2023 14:59:57 GMT, Raffaello Giulietti wrote: >> Roger Riggs has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Refactored extractCodePoints to avoid multiple resizes if the array was >> modified >> - Replaced isLatin1

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-10 Thread Raffaello Giulietti
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-09 Thread Gui Cao
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-09 Thread Roger Riggs
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-09 Thread Roger Riggs
On Thu, 9 Nov 2023 09:07:31 GMT, Chen Liang wrote: > Just curious, how does benchmark > StringConstructor.newStringFromCharsMixedBegin change before and after this > patch? If we can see how much of an impact this has on CJK strings it would > be appreciated. You may have better insights from

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-09 Thread Chen Liang
On Mon, 6 Nov 2023 15:30:46 GMT, Roger Riggs wrote: >> src/java.base/share/classes/java/lang/StringUTF16.java line 202: >> >>> 200: @ForceInline >>> 201: public static byte[] compress(final char[] val, final int off, >>> final int count) { >>> 202: byte[] latin1 = new byte[count

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-09 Thread Tobias Hartmann
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-08 Thread Roger Riggs
> Strings, after construction, are immutable but may be constructed from > mutable arrays of bytes, characters, or integers. > The string constructors should guard against the effects of mutating the > arrays during construction that might invalidate internal invariants for the > correct behavio