[jdk22] Integrated: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled

2023-12-19 Thread Aleksei Voitylov
On Mon, 18 Dec 2023 11:56:50 GMT, Aleksei Voitylov wrote: > Hi all, > > This pull request contains a backport of commit > [fde5b168](https://github.com/openjdk/jdk/commit/fde5b16817c3263236993f2e8c2d2469610d99bd) > from the [openjdk/jdk](https://git.openjdk.org/jdk) repos

Re: [jdk22] RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled

2023-12-19 Thread Aleksei Voitylov
On Mon, 18 Dec 2023 11:56:50 GMT, Aleksei Voitylov wrote: > Hi all, > > This pull request contains a backport of commit > [fde5b168](https://github.com/openjdk/jdk/commit/fde5b16817c3263236993f2e8c2d2469610d99bd) > from the [openjdk/jdk](https://git.openjdk.org/jdk) repos

[jdk22] RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled

2023-12-18 Thread Aleksei Voitylov
Hi all, This pull request contains a backport of commit [fde5b168](https://github.com/openjdk/jdk/commit/fde5b16817c3263236993f2e8c2d2469610d99bd) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Aleksei Voitylov on 14 Dec 2023 and

Integrated: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled

2023-12-14 Thread Aleksei Voitylov
On Mon, 11 Dec 2023 13:48:18 GMT, Aleksei Voitylov wrote: > Since JDK-8311906, if CompactStrings is not enabled, index is not considered > when calling extractCodepoints from StringUTF16.toBytes(). Because of that > the last elements of the source codepoints array are stripped

Re: RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled [v3]

2023-12-14 Thread Aleksei Voitylov
On Wed, 13 Dec 2023 11:39:19 GMT, Aleksei Voitylov wrote: >> Since JDK-8311906, if CompactStrings is not enabled, index is not considered >> when calling extractCodepoints from StringUTF16.toBytes(). Because of that >> the last elements of the source codepoints array are

Re: RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled [v2]

2023-12-13 Thread Aleksei Voitylov
On Tue, 12 Dec 2023 19:11:43 GMT, Roger Riggs wrote: >> Aleksei Voitylov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> review comments > > test/jdk/java/lang/String/Chars.java line 50: > >> 48:

Re: RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled [v3]

2023-12-13 Thread Aleksei Voitylov
On Wed, 13 Dec 2023 11:39:19 GMT, Aleksei Voitylov wrote: >> Since JDK-8311906, if CompactStrings is not enabled, index is not considered >> when calling extractCodepoints from StringUTF16.toBytes(). Because of that >> the last elements of the source codepoints array are

Re: RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled [v3]

2023-12-13 Thread Aleksei Voitylov
(e.g. during RegEx > processing). > > The fix replaces len in extractCodepoints parameters with end that is index + > len. Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision: review comments -

Re: RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled [v2]

2023-12-12 Thread Aleksei Voitylov
On Tue, 12 Dec 2023 10:47:48 GMT, Aleksei Voitylov wrote: >> Since JDK-8311906, if CompactStrings is not enabled, index is not considered >> when calling extractCodepoints from StringUTF16.toBytes(). Because of that >> the last elements of the source codepoints array are

Re: RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled [v2]

2023-12-12 Thread Aleksei Voitylov
(e.g. during RegEx > processing). > > The fix replaces len in extractCodepoints parameters with end that is index + > len. Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision: review comments -

RFR: 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled

2023-12-11 Thread Aleksei Voitylov
Since JDK-8311906, if CompactStrings is not enabled, index is not considered when calling extractCodepoints from StringUTF16.toBytes(). Because of that the last elements of the source codepoints array are stripped from the resulting UTF16 string, which fires in other places (e.g. during RegEx pr

Integrated: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163

2023-09-28 Thread Aleksei Voitylov
On Mon, 25 Sep 2023 15:52:12 GMT, Aleksei Voitylov wrote: > test java.lang.String.RegionMatches1Tests fails on all platforms with > -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by > default. The fix is to return true immediately if len is negative,

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v6]

2023-09-28 Thread Aleksei Voitylov
On Wed, 27 Sep 2023 14:13:05 GMT, Aleksei Voitylov wrote: >> test java.lang.String.RegionMatches1Tests fails on all platforms with >> -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by >> default. The fix is to return true immediately if len is n

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v6]

2023-09-27 Thread Aleksei Voitylov
be satisfied. > > Testing: JCK, JTREG passed with the fix with -XX:-CompactStrings on x86_64 > and on ARM32. Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision: address review comments - Changes: - all: https://git

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v5]

2023-09-27 Thread Aleksei Voitylov
On Wed, 27 Sep 2023 13:27:10 GMT, Roger Riggs wrote: >> Aleksei Voitylov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> address review comments > > test/jdk/java/lang/String/RegionMatches.java line 41: >

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v5]

2023-09-27 Thread Aleksei Voitylov
On Wed, 27 Sep 2023 09:58:58 GMT, Aleksei Voitylov wrote: >> test java.lang.String.RegionMatches1Tests fails on all platforms with >> -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by >> default. The fix is to return true immediately if len is n

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v5]

2023-09-27 Thread Aleksei Voitylov
be satisfied. > > Testing: JCK, JTREG passed with the fix with -XX:-CompactStrings on x86_64 > and on ARM32. Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision: address review comments - Changes: - all: https://git

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v3]

2023-09-26 Thread Aleksei Voitylov
On Tue, 26 Sep 2023 14:29:05 GMT, Roger Riggs wrote: >> Aleksei Voitylov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.base/share/classes/java/lang/String.java >> >> Co-autho

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v4]

2023-09-26 Thread Aleksei Voitylov
be satisfied. > > Testing: JCK, JTREG passed with the fix with -XX:-CompactStrings on x86_64 > and on ARM32. Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision: address review comments - Changes: - all: https://git

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v2]

2023-09-26 Thread Aleksei Voitylov
On Tue, 26 Sep 2023 12:38:46 GMT, Aleksei Voitylov wrote: >> test java.lang.String.RegionMatches1Tests fails on all platforms with >> -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by >> default. The fix is to return true immediately if len is n

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v3]

2023-09-26 Thread Aleksei Voitylov
be satisfied. > > Testing: JCK, JTREG passed with the fix with -XX:-CompactStrings on x86_64 > and on ARM32. Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/java/lang/String.java Co-a

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v2]

2023-09-26 Thread Aleksei Voitylov
be satisfied. > > Testing: JCK, JTREG passed with the fix with -XX:-CompactStrings on x86_64 > and on ARM32. Aleksei Voitylov has updated the pull request incrementally with one additional commit since the last revision: add regression test - Changes: - all: https://git.openj

RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163

2023-09-25 Thread Aleksei Voitylov
test java.lang.String.RegionMatches1Tests fails on all platforms with -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by default. The fix is to return true immediately if len is negative, since for negative length this condition will never be satisfied. Testing: JCK, J

Integrated: 8294198: Implement isFinite intrinsic for RISC-V

2022-09-29 Thread Aleksei Voitylov
On Thu, 22 Sep 2022 12:56:49 GMT, Aleksei Voitylov wrote: > Unlike on x86 (see 8285868 and the discussion in review), isFinite intrinsic > turned out to be profitable on RISC-V using the same fclass instruction as > for 8293695 (isInfinite instrinsic). Therefore, I'm propos

Re: RFR: 8294198: Implement isFinite intrinsic for RISC-V

2022-09-29 Thread Aleksei Voitylov
On Thu, 22 Sep 2022 17:20:02 GMT, Joe Darcy wrote: >> Unlike on x86 (see 8285868 and the discussion in review), isFinite intrinsic >> turned out to be profitable on RISC-V using the same fclass instruction as >> for 8293695 (isInfinite instrinsic). Therefore, I'm proposing to have it >> added

Re: RFR: 8294198: Implement isFinite intrinsic for RISC-V

2022-09-27 Thread Aleksei Voitylov
On Thu, 22 Sep 2022 12:56:49 GMT, Aleksei Voitylov wrote: > Unlike on x86 (see 8285868 and the discussion in review), isFinite intrinsic > turned out to be profitable on RISC-V using the same fclass instruction as > for 8293695 (isInfinite instrinsic). Therefore, I'm propos

Re: RFR: 8294198: Implement isFinite intrinsic for RISC-V

2022-09-23 Thread Aleksei Voitylov
On Thu, 22 Sep 2022 12:56:49 GMT, Aleksei Voitylov wrote: > Unlike on x86 (see 8285868 and the discussion in review), isFinite intrinsic > turned out to be profitable on RISC-V using the same fclass instruction as > for 8293695 (isInfinite instrinsic). Therefore, I'm propos

RFR: 8294198: Implement isFinite intrinsic for RISC-V

2022-09-22 Thread Aleksei Voitylov
Unlike on x86 (see 8285868 and the discussion in review), isFinite intrinsic turned out to be profitable on RISC-V using the same fclass instruction as for 8293695 (isInfinite instrinsic). Therefore, I'm proposing to have it added on RISC-V in this PR. benchmark results: before: Benchmark