Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-06 Thread Raffaello Giulietti
On Fri, 6 Oct 2023 03:16:50 GMT, Quan Anh Mai wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Avoid localized integers in radix-out-of-range exception messages. > > Could we p

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-06 Thread Raffaello Giulietti
On Fri, 6 Oct 2023 03:06:08 GMT, Quan Anh Mai wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Avoid localized integers in radix-out-of-range exception messages. > > src/jav

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v15]

2023-10-05 Thread Raffaello Giulietti
On Thu, 28 Sep 2023 21:40:17 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v15]

2023-10-05 Thread Raffaello Giulietti
On Thu, 28 Sep 2023 21:40:17 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-05 Thread Raffaello Giulietti
On Thu, 5 Oct 2023 10:31:31 GMT, Raffaello Giulietti wrote: >> See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the >> details. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since the last revision: &

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-05 Thread Raffaello Giulietti
> See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the > details. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Avoid localized integers in radix-out-of-range exception messages. - C

RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long

2023-10-05 Thread Raffaello Giulietti
See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the details. - Commit messages: - 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long Changes: https://git.openjdk.org/jdk/pull/16050/files Webrev:

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float) [v2]

2023-09-29 Thread Raffaello Giulietti
On Fri, 29 Sep 2023 18:56:26 GMT, 温绍锦 wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Uppercase JLA. > > src/java.base/share/classes/jdk/internal/math/DoubleToDecimal.java li

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v2]

2023-09-29 Thread Raffaello Giulietti
0913/specs/instanceof-jls.html > > Aggelos Biboudis has updated the pull request incrementally with one > additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Raffaello Giulietti I just had a reading at the `ExactnessMethods`

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v2]

2023-09-28 Thread Raffaello Giulietti
0913/specs/instanceof-jls.html > > Aggelos Biboudis has updated the pull request incrementally with one > additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Raffaello Giulietti There might be good reasons to have: - `byte_

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v13]

2023-09-28 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 21:26:46 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v12]

2023-09-28 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 19:13:02 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v13]

2023-09-28 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 21:26:46 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v12]

2023-09-27 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 19:13:02 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

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

2023-09-27 Thread Raffaello Giulietti
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 negative, since for

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v11]

2023-09-27 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 09:35:47 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

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

2023-09-27 Thread Raffaello Giulietti
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 negative, since for

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v7]

2023-09-27 Thread Raffaello Giulietti
On Mon, 25 Sep 2023 12:20:36 GMT, 温绍锦 wrote: >>> The reason why I split it into multiple small methods is to avoid a single >>> method codeSize > 325. After merging small methods, the performance will >>> decrease. >> >> Yes, I can refactor to keep the same structure and verify performance is

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

2023-09-27 Thread Raffaello Giulietti
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 negative, since for

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

2023-09-27 Thread Raffaello Giulietti
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 negative, since for

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

2023-09-26 Thread Raffaello Giulietti
On Tue, 26 Sep 2023 16:23:58 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 was converted to testng and >> split

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

2023-09-26 Thread Raffaello Giulietti
Since the tests are now TestNG, I think it would make more sense to use TestNG `assertTrue` rather than using explicit `if`s and `throw`s. On 2023-09-26 16:09, Aleksei Voitylov wrote: On Tue, 26 Sep 2023 12:38:46 GMT, Aleksei Voitylov wrote: test java.lang.String.RegionMatches1Tests

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview)

2023-09-26 Thread Raffaello Giulietti
On Fri, 8 Sep 2023 14:17:29 GMT, Aggelos Biboudis wrote: > This is the first draft of a patch for Primitive types in patterns, > instanceof, and switch (Preview). > > Draft spec here: > https://cr.openjdk.org/~abimpoudis/instanceof/instanceof-20230913/specs/instanceof-jls.html

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

2023-09-26 Thread Raffaello Giulietti
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 negative, since for

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float) [v2]

2023-09-22 Thread Raffaello Giulietti
> By correctly sizing an intermediate `byte[]` and making use of the internal > `newStringNoRepl()` method, one allocation per conversion can be avoided when > the runtime uses compact strings. Raffaello Giulietti has updated the pull request incrementally with one additional com

Re: RFR: JDK-8316708: Augment WorstCaseTests with more cases

2023-09-22 Thread Raffaello Giulietti
On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy wrote: > A new paper > > "Accuracy of Mathematical Functions in Single, Double, Double Extended, and > Quadruple Precision" > by Brian Gladman, Vincenzo Innocente and Paul Zimmermann > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > >

Re: RFR: JDK-8316708: Augment WorstCaseTests with more cases

2023-09-22 Thread Raffaello Giulietti
On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy wrote: > A new paper > > "Accuracy of Mathematical Functions in Single, Double, Double Extended, and > Quadruple Precision" > by Brian Gladman, Vincenzo Innocente and Paul Zimmermann > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > >

Re: RFR: JDK-8316708: Augment WorstCaseTests with more cases

2023-09-22 Thread Raffaello Giulietti
On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy wrote: > A new paper > > "Accuracy of Mathematical Functions in Single, Double, Double Extended, and > Quadruple Precision" > by Brian Gladman, Vincenzo Innocente and Paul Zimmermann > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > >

Re: RFR: JDK-8316688: Widen allowable error bound of Math.hypot

2023-09-21 Thread Raffaello Giulietti
On Thu, 21 Sep 2023 19:19:34 GMT, Joe Darcy wrote: > The Math.hypot method claims its error bound is one ulp. > > The paper > > "Accuracy of Mathematical Functions in Single, Double, Double > Extended, and Quadruple Precision" > Brian Gladman, Vincenzo Innocente and Paul Zimmermann > September

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float)

2023-09-21 Thread Raffaello Giulietti
On Thu, 21 Sep 2023 12:51:56 GMT, Raffaello Giulietti wrote: > By correctly sizing an intermediate `byte[]` and making use of the internal > `newStringNoRepl()` method, one allocation per conversion can be avoided when > the runtime uses compact strings. On my platform, conversions

RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float)

2023-09-21 Thread Raffaello Giulietti
By correctly sizing an intermediate `byte[]` and making use of the internal `newStringNoRepl()` method, one allocation per conversion can be avoided when the runtime uses compact strings. - Commit messages: - 8316662: Remove one allocation per conversion in Double.toString(double)

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-08 Thread Raffaello Giulietti
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-06 Thread Raffaello Giulietti
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny

Re: RFR: 8313961: Enhance identification of special serialization methods

2023-08-23 Thread Raffaello Giulietti
Here's some more context about the issues that the PR attempts to fix. Currently, serialization identifies special "magic" methods by querying classical reflection. It does so by invoking `getDeclaredMethod(name, parametertypes)`. This works correctly under the assumption that a serializable

Re: RFR: 8313961: Enhance identification of special serialization methods [v2]

2023-08-21 Thread Raffaello Giulietti
On Mon, 21 Aug 2023 16:13:37 GMT, ExE Boss wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Removed a spurious, unintended file. > > src/java.base/share/classes/java/io/Ob

Re: RFR: 8313961: Enhance identification of special serialization methods

2023-08-21 Thread Raffaello Giulietti
On Mon, 21 Aug 2023 15:46:53 GMT, Raffaello Giulietti wrote: > This improves the identification of the serialization magic fields and > methods. The test is a bit unusual, in that it uses the [Classfile API](https://openjdk.org/jeps/8280389). It is used to generate two classes that

Re: RFR: 8313961: Enhance identification of special serialization methods [v2]

2023-08-21 Thread Raffaello Giulietti
> This improves the identification of the serialization magic fields and > methods. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Removed a spurious, unintended file. - Changes: - all:

RFR: 8313961: Enhance identification of special serialization methods

2023-08-21 Thread Raffaello Giulietti
This improves the identification of the serialization magic fields and methods. - Commit messages: - 8313961: Enhance identification of special serialization methods - 8313961: Enhance identification of special serialization methods - Merge branch 'master' into 8313961 - 8313961:

[jdk21] Withdrawn: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match

2023-08-17 Thread Raffaello Giulietti
On Fri, 4 Aug 2023 08:58:46 GMT, Raffaello Giulietti wrote: > Hi all, > > This pull request contains a backport of commit > [61c58fdd](https://github.com/openjdk/jdk/commit/61c58fdd00727da2841a052477e4f4ecfa7094d6) > from the [openjdk/jdk](https://git.openjdk.org/

Re: RFR: JDK-8314489: Add javadoc index entries for java.lang.Math terms

2023-08-17 Thread Raffaello Giulietti
On Thu, 17 Aug 2023 04:52:59 GMT, Joe Darcy wrote: > Use of javadoc search index feature; I'll re-flow paragraphs before pushing > once the wording is agreed to. What about `semi-monotonic` on L.80? Does it deserve to be tagged as `` and indexed? - PR Review:

Re: [External] : Re: Different costs of accessing volatile reference and array

2023-08-16 Thread Raffaello Giulietti
I guess that the cost for an array element access is more expensive than accessing a field, regardless of volatile. The offset is computed at runtime for an array element and might need to be checked to be in the range of valid indices, while the offset of a field is known and can be a

Re: Different costs of accessing volatile reference and array

2023-08-16 Thread Raffaello Giulietti
If I read the data correctly, for the count=100 case in jdk 20 it takes 109 ns/op for the array and 74 ns/op for the field. To me this looks like a field access is _less_ expensive. Am I missing something? On 2023-08-16 13:37, Сергей Цыпанов wrote: Hello, I was measuring costs of hoisting

Integrated: 8314209: Wrong @since tag for RandomGenerator::equiDoubles

2023-08-16 Thread Raffaello Giulietti
On Wed, 16 Aug 2023 08:07:05 GMT, Raffaello Giulietti wrote: > Please review this trivial typo. > TIA This pull request has now been integrated. Changeset: b80001de Author:Raffaello Giulietti URL: https://git.openjdk.org/jdk/commit/b80001de0c0aeedeb412430660a4727fc26be98b

RFR: 8314209: Wrong @since tag for RandomGenerator::equiDoubles

2023-08-16 Thread Raffaello Giulietti
Please review this trivial typo. TIA - Commit messages: - 8314209: Wrong @since tag for RandomGenerator::equiDoubles Changes: https://git.openjdk.org/jdk/pull/15303/files Webrev: https://webrevs.openjdk.org/?repo=jdk=15303=00 Issue: https://bugs.openjdk.org/browse/JDK-8314209

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger [v6]

2023-08-10 Thread Raffaello Giulietti
On Wed, 9 Aug 2023 22:36:47 GMT, Claes Redestad wrote: >> Pavel Rappo has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 13 additional >> commits

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger [v6]

2023-08-10 Thread Raffaello Giulietti
On Thu, 10 Aug 2023 11:23:02 GMT, Pavel Rappo wrote: >> AFAIK, if you need reproducible randoms in tests, you should add the tags: >> >> * @key randomness >> * @library /test/lib >> >> and initialize your random generator with >> >> import jdk.test.lib.RandomFactory; >> ... >> Random rnd =

Re: RFR: 8313875: Use literals instead of static fields in java.util.Math: twoToTheDoubleScaleUp, twoToTheDoubleScaleDown [v2]

2023-08-08 Thread Raffaello Giulietti
On Mon, 7 Aug 2023 19:44:48 GMT, Andrey Turbanov wrote: >> Couple of static fields in Math are used only once and can be replaced with >> literals `0x1p512`/`0x1p-512 ` > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > >

Re: RFR: 8313875: Use literals instead of static fields in java.util.Math: twoToTheDoubleScaleUp, twoToTheDoubleScaleDown [v2]

2023-08-08 Thread Raffaello Giulietti
On Mon, 7 Aug 2023 19:44:48 GMT, Andrey Turbanov wrote: >> Couple of static fields in Math are used only once and can be replaced with >> literals `0x1p512`/`0x1p-512 ` > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > >

Re: RFR: 8313875: Use literals instead of static fields in java.util.Math: twoToTheDoubleScaleUp, twoToTheDoubleScaleDown [v2]

2023-08-08 Thread Raffaello Giulietti
On Mon, 7 Aug 2023 19:44:48 GMT, Andrey Turbanov wrote: >> Couple of static fields in Math are used only once and can be replaced with >> literals `0x1p512`/`0x1p-512 ` > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > >

Re: RFR: 8313875: Make fields final in java.util.Math: twoToTheDoubleScaleUp, twoToTheDoubleScaleDown

2023-08-07 Thread Raffaello Giulietti
On Mon, 7 Aug 2023 17:35:34 GMT, Andrey Turbanov wrote: >> src/java.base/share/classes/java/lang/Math.java line 3425: >> >>> 3423: // Constants used in scalb >>> 3424: private static final double twoToTheDoubleScaleUp = >>> powerOfTwoD(512); >>> 3425: private static final double

Re: RFR: 8313875: Make fields final in java.util.Math: twoToTheDoubleScaleUp, twoToTheDoubleScaleDown

2023-08-07 Thread Raffaello Giulietti
On Thu, 13 Jul 2023 17:57:16 GMT, Andrey Turbanov wrote: > Couple of static fields in Math could be declared `final`. src/java.base/share/classes/java/lang/Math.java line 3425: > 3423: // Constants used in scalb > 3424: private static final double twoToTheDoubleScaleUp = >

Re: RFR: 8311517: Add performance information to ArrayList javadoc [v2]

2023-08-04 Thread Raffaello Giulietti
On Thu, 27 Jul 2023 06:31:06 GMT, dan1st wrote: >> The [JEP for sequenced collections](https://openjdk.org/jeps/431) would add >> addFirst(), removeFirst() and reversed() methods to lists. >> However, the Javadoc of List mentions: >> > The size, isEmpty, get, set, iterator, and listIterator

[jdk21] RFR: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match

2023-08-04 Thread Raffaello Giulietti
Hi all, This pull request contains a backport of commit [61c58fdd](https://github.com/openjdk/jdk/commit/61c58fdd00727da2841a052477e4f4ecfa7094d6) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Raffaello Giulietti on 4 Aug 2023

Integrated: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match

2023-08-04 Thread Raffaello Giulietti
On Thu, 27 Jul 2023 11:25:57 GMT, Raffaello Giulietti wrote: > Fixes a bug showing up after > [JDK-8132995](https://bugs.openjdk.org/browse/JDK-8132995) when there are > capturing groups outside the match. This pull request has now been integrated. Changeset: 61c58fdd Author:

Re: RFR: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match [v4]

2023-08-03 Thread Raffaello Giulietti
On Mon, 31 Jul 2023 18:38:30 GMT, Raffaello Giulietti wrote: >> Fixes a bug showing up after >> [JDK-8132995](https://bugs.openjdk.org/browse/JDK-8132995) when there are >> capturing groups outside the match. > > Raffaello Giulietti has updated the pull request wi

Re: RFR: 8311939: Excessive allocation of Matcher.groups array [v4]

2023-08-03 Thread Raffaello Giulietti
On Fri, 28 Jul 2023 12:15:21 GMT, Cristian Vat wrote: >> Reduces excessive allocation of Matcher.groups array when the original >> Pattern has no groups or less than 9 groups. >> >> Original clamping to 10 possibly due to documented behavior from javadoc: >> "In this class, \1 through \9 are

Re: RFR: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match [v4]

2023-07-31 Thread Raffaello Giulietti
> Fixes a bug showing up after > [JDK-8132995](https://bugs.openjdk.org/browse/JDK-8132995) when there are > capturing groups outside the match. Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the

Re: RFR: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match [v3]

2023-07-31 Thread Raffaello Giulietti
> Fixes a bug showing up after > [JDK-8132995](https://bugs.openjdk.org/browse/JDK-8132995) when there are > capturing groups outside the match. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Refactored rec

Re: RFR: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match [v2]

2023-07-31 Thread Raffaello Giulietti
> Fixes a bug showing up after > [JDK-8132995](https://bugs.openjdk.org/browse/JDK-8132995) when there are > capturing groups outside the match. Raffaello Giulietti has updated the pull request incrementally with two additional commits since the last revision: - Added a test with

RFR: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match

2023-07-27 Thread Raffaello Giulietti
Fixes a bug showing up after [JDK-8132995](https://bugs.openjdk.org/browse/JDK-8132995) when there are capturing groups outside the match. - Commit messages: - 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match Changes:

Re: RFR: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match

2023-07-27 Thread Raffaello Giulietti
On Thu, 27 Jul 2023 11:25:57 GMT, Raffaello Giulietti wrote: > Fixes a bug showing up after > [JDK-8132995](https://bugs.openjdk.org/browse/JDK-8132995) when there are > capturing groups outside the match. Once integrated in mainline, the fix should be backported to 21, wher

Integrated: 8302987: Add uniform and spatially equidistributed bounded double streams to RandomGenerator

2023-07-19 Thread Raffaello Giulietti
On Wed, 22 Feb 2023 15:23:13 GMT, Raffaello Giulietti wrote: > The `default` method `nextDouble(double origin, double bound)` in > `java.util.random.RandomGenerator` aims at generating a uniformly and > spatially equidistributed random `double` in the left-closed and right-open

Re: RFR: 8302987: Add uniform and spatially equidistributed bounded double streams to RandomGenerator [v12]

2023-07-18 Thread Raffaello Giulietti
when applying > the affine transform. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Made the comment about not using ulp a bit clearer. - Changes: - all: https://git.openjdk.org/jdk/pull/12719/files - new: ht

Re: RFR: 8302987: Add uniform and spatially equidistributed bounded double streams to RandomGenerator [v11]

2023-07-18 Thread Raffaello Giulietti
when applying > the affine transform. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Added the reason for not using Math.ulp() to compute delta. - Changes: - all: https://git.openjdk.org/jdk/pull/12719/files

Re: RFR: 8302987: Add uniform and spatially equidistributed bounded double streams to RandomGenerator [v10]

2023-07-18 Thread Raffaello Giulietti
On Tue, 18 Jul 2023 02:54:55 GMT, Joe Darcy wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Correction in comment. > > src/java.base/share/classes/java/util/random/RandomGene

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger [v2]

2023-07-10 Thread Raffaello Giulietti
On Mon, 10 Jul 2023 14:39:51 GMT, Raffaello Giulietti wrote: >> Back to your two suggestions, Raffaello. On the one hand, I think it's hard >> to beat the readability of `?:`. On the other hand, such comparison is >> performance-sensitive and is a pattern in BigInteger. S

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger [v2]

2023-07-10 Thread Raffaello Giulietti
On Mon, 10 Jul 2023 14:39:51 GMT, Raffaello Giulietti wrote: >> Back to your two suggestions, Raffaello. On the one hand, I think it's hard >> to beat the readability of `?:`. On the other hand, such comparison is >> performance-sensitive and is a pattern in BigInteger. S

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger [v2]

2023-07-10 Thread Raffaello Giulietti
On Mon, 10 Jul 2023 13:48:34 GMT, Pavel Rappo wrote: >> Yep, you're right. > > Back to your two suggestions, Raffaello. On the one hand, I think it's hard > to beat the readability of `?:`. On the other hand, such comparison is > performance-sensitive and is a pattern in BigInteger. So we

Re: RFR: 8311030: ResourceBundle.handleKeySet() is racy

2023-06-30 Thread Raffaello Giulietti
On Wed, 28 Jun 2023 11:05:11 GMT, Sergey Tsypanov wrote: > Double-checked locking should rely on local variable to avoid racy reads from > volatile field. True. I was mislead because the return statement does not appear in the changeset (the line is textually the same, although it has a

Re: RFR: 8311030: ResourceBundle.handleKeySet() is racy

2023-06-29 Thread Raffaello Giulietti
On Wed, 28 Jun 2023 11:05:11 GMT, Sergey Tsypanov wrote: > Double-checked locking should rely on local variable to avoid racy reads from > volatile field. The role of the local `keySet` seems pretty useless. It doesn't save neither volatile reads nor writes. - PR Comment:

Re: RFR: 8310929: Optimization for Integer.toString

2023-06-28 Thread Raffaello Giulietti
On Wed, 28 Jun 2023 17:06:56 GMT, 温绍锦 wrote: > Speed up Integer.toString with a precomputed cache array of length 1000, use > division by 1000, so that each iteration can calculate three digits. > > this optimization can also be used in StringBuilder#appent(int) and > Long#toString. > > #

Re: RFR: JDK-8311009: Long.toUnsignedString(long, int) doesn't have to create a BigInteger [v2]

2023-06-28 Thread Raffaello Giulietti
On Wed, 28 Jun 2023 07:57:25 GMT, Tingjun Yuan wrote: >> This PR changes the implementation of `Long.toUnsignedString(long, int)` for >> "default" radices, which avoids creating a `BigInteger` and makes use of >> `Long.divideUnsigned` and `Long.remainderUnsigned`. >> >> I've run the test on

Re: RFR: JDK-8311009: Long.toUnsignedString(long, int) doesn't have to create a BigInteger

2023-06-28 Thread Raffaello Giulietti
On Mon, 26 Jun 2023 14:58:56 GMT, Tingjun Yuan wrote: > This PR changes the implementation of `Long.toUnsignedString(long, int)` for > "default" radices, which avoids creating a `BigInteger` and makes use of > `Long.divideUnsigned` and `Long.remainderUnsigned`. > > I've run the test on

Re: RFR: 8310033: Clarify return value of Java Time compareTo methods [v3]

2023-06-27 Thread Raffaello Giulietti
On Wed, 21 Jun 2023 16:29:40 GMT, Roger Riggs wrote: >> In java.time packages, clarify timeline order javadoc to mention "before" >> and "after" in the value of the `compareTo` method return values. >> Add javadoc @see tags to isBefore and isAfter methods >> >> Replace use of "negative" and

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger

2023-06-26 Thread Raffaello Giulietti
On Mon, 26 Jun 2023 14:38:53 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 1: >> >>> 1: /* >> >> On L.3932, I think you can simplify >> >> return signum > val.signum ? 1 : -1; >> >> with >> >> return signum; > > Thanks for looking at

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger

2023-06-26 Thread Raffaello Giulietti
On Fri, 23 Jun 2023 17:27:00 GMT, Pavel Rappo wrote: > Please review this PR to use modern APIs and language features to simplify > equals, hashCode, and compareTo for BigInteger. If you have any performance > concerns, please raise them. > > This PR is cherry-picked from a bigger,

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger

2023-06-26 Thread Raffaello Giulietti
On Fri, 23 Jun 2023 17:27:00 GMT, Pavel Rappo wrote: > Please review this PR to use modern APIs and language features to simplify > equals, hashCode, and compareTo for BigInteger. If you have any performance > concerns, please raise them. > > This PR is cherry-picked from a bigger,

Re: RFR: 8310502 : optimization for UUID#toString [v2]

2023-06-21 Thread Raffaello Giulietti
On Wed, 21 Jun 2023 10:11:09 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

Integrated: 8309955: Matcher uses @since {@inheritDoc}

2023-06-13 Thread Raffaello Giulietti
On Tue, 13 Jun 2023 18:55:20 GMT, Raffaello Giulietti wrote: > Hi all, > > This pull request contains a backport of commit > [bfef3c3e](https://github.com/openjdk/jdk/commit/bfef3c3e80d4df98bdb0d853c2e2711cdd8252ce) > from the [openjdk/jdk](https://git.openjdk.org/

RFR: 8309955: Matcher uses @since {@inheritDoc}

2023-06-13 Thread Raffaello Giulietti
Hi all, This pull request contains a backport of commit [bfef3c3e](https://github.com/openjdk/jdk/commit/bfef3c3e80d4df98bdb0d853c2e2711cdd8252ce) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Raffaello Giulietti on 13 Jun 2023

Integrated: 8309955: Matcher uses @since {@inheritDoc}

2023-06-13 Thread Raffaello Giulietti
On Tue, 13 Jun 2023 18:08:55 GMT, Raffaello Giulietti wrote: > Trivial fix to working but unsupported use of {@inheritDoc} This pull request has now been integrated. Changeset: bfef3c3e Author: Raffaello Giulietti URL: https://git.openjdk.org/jdk/com

RFR: 8309955: Matcher uses @since {@inheritDoc}

2023-06-13 Thread Raffaello Giulietti
Trivial fix to working but unsupported use of {@inheritDoc} - Commit messages: - 8309955: Matcher uses @since {@inheritDoc} Changes: https://git.openjdk.org/jdk/pull/14452/files Webrev: https://webrevs.openjdk.org/?repo=jdk=14452=00 Issue:

Integrated: 8309515: Stale cached data from Matcher.namedGroups() after Matcher.usePattern()

2023-06-07 Thread Raffaello Giulietti
On Wed, 7 Jun 2023 11:20:02 GMT, Raffaello Giulietti wrote: > The cached `namedGroup` field must be invalidated during an invocation of > `Matcher.usePattern()` This pull request has now been integrated. Changeset: 90027ff2 Author:Raffaello Giulietti URL: https://git.openj

Re: RFR: 8309515: Stale cached data from Matcher.namedGroups() after Matcher.usePattern() [v3]

2023-06-07 Thread Raffaello Giulietti
> The cached `namedGroup` field must be invalidated during an invocation of > `Matcher.usePattern()` Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Added descriptions to the RuntimeExceptions in th

Re: RFR: 8309515: Stale cached data from Matcher.namedGroups() after Matcher.usePattern() [v2]

2023-06-07 Thread Raffaello Giulietti
On Wed, 7 Jun 2023 17:51:48 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Renamed the additional test. > > test/jdk/java/util/regex/NamedGroups

Re: RFR: 8309515: Stale cached data from Matcher.namedGroups() after Matcher.usePattern() [v2]

2023-06-07 Thread Raffaello Giulietti
> The cached `namedGroup` field must be invalidated during an invocation of > `Matcher.usePattern()` Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Renamed the additional test. - Changes: - all:

Re: RFR: 8309515: Stale cached data from Matcher.namedGroups() after Matcher.usePattern()

2023-06-07 Thread Raffaello Giulietti
On Wed, 7 Jun 2023 11:20:02 GMT, Raffaello Giulietti wrote: > The cached `namedGroup` field must be invalidated during an invocation of > `Matcher.usePattern()` Also added a test for this change. - PR Comment: https://git.openjdk.org/jdk/pull/14350#issuecomment-1580578032

RFR: 8309515: Stale cached data from Matcher.namedGroups() after Matcher.usePattern()

2023-06-07 Thread Raffaello Giulietti
The cached `namedGroup` field must be invalidated during an invocation of `Matcher.usePattern()` - Commit messages: - 8309515: Stale cached data from Matcher.namedGroups() after Matcher.usePattern() Changes: https://git.openjdk.org/jdk/pull/14350/files Webrev:

Re: RFR: 8302987: Add uniform and spatially equidistributed bounded double streams to RandomGenerator [v10]

2023-05-31 Thread Raffaello Giulietti
when applying > the affine transform. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Correction in comment. - Changes: - all: https://git.openjdk.org/jdk/pull/12719/files - new: https://git.openjdk.org/jdk/pull/

Re: [External] : Re: Classes used in method body are loaded lazily or eagerly depending on method return type

2023-05-26 Thread Raffaello Giulietti
URL classFileB = TestLoading.class.getResource(TestLoading.class.getPackageName() + "ChildClass.class"); will remove the class without loading it, and will later throw, as in the original setup. Sorry for the noise Raffaello On 2023-05-26 08:10, David Holmes wrote: On 25/05/2023 7:21 pm, Ra

Re: [External] : Re: Classes used in method body are loaded lazily or eagerly depending on method return type

2023-05-25 Thread Raffaello Giulietti
, David Holmes wrote: On 25/05/2023 12:34 am, Raffaello Giulietti wrote: As mentioned in my previous email, if you move the member class ChildClass out of TestLoading (out of the nest), and make it a top-level class like public class ChildClass extends TestLoading.BaseClass

Re: [External] : Re: Classes used in method body are loaded lazily or eagerly depending on method return type

2023-05-24 Thread Raffaello Giulietti
e: - Original Message - From: "David Holmes" To: "Raffaello Giulietti" , "core-libs-dev" Sent: Wednesday, May 24, 2023 12:23:24 AM Subject: Re: Classes used in method body are loaded lazily or eagerly depending on method return type On 24/05/

Re: Classes used in method body are loaded lazily or eagerly depending on method return type

2023-05-23 Thread Raffaello Giulietti
I think the problem here is that you are deleting a class in a nest. During the verification of BaseClassReturner.getObject(), access control (JVMS, 5.4.4, second half) determines that the nest is broken, as ChildClass is not present anymore. If you move ChildClass out of TestLoading so that

Integrated: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage

2023-05-19 Thread Raffaello Giulietti
On Wed, 29 Mar 2023 18:09:22 GMT, Raffaello Giulietti wrote: > When appropriate and useful, copies only the relevant portion of the > `CharSequence` to the match result. This pull request has now been integrated. Changeset: 25868b95 Author:Raffaello Giulietti URL:

Re: RFR: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage [v4]

2023-05-17 Thread Raffaello Giulietti
On Wed, 17 May 2023 15:05:53 GMT, Raffaello Giulietti wrote: >> When appropriate and useful, copies only the relevant portion of the >> `CharSequence` to the match result. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit si

Re: RFR: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage [v3]

2023-05-17 Thread Raffaello Giulietti
On Wed, 17 May 2023 14:42:52 GMT, Claes Redestad wrote: >> Raffaello Giulietti has updated the pull request with a new target base due >> to a merge or a rebase. The incremental webrev excludes the unrelated >> changes brought in by the merge/rebase. The pull req

Re: RFR: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage [v4]

2023-05-17 Thread Raffaello Giulietti
> When appropriate and useful, copies only the relevant portion of the > `CharSequence` to the match result. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Simplified text capturing. - Changes: - all:

Re: RFR: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage [v2]

2023-05-17 Thread Raffaello Giulietti
On Wed, 17 May 2023 04:50:14 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/regex/Matcher.java line 1381: >> >>> 1379: >>> 1380: // Capture the input sequence as a string on first >>> find >>> 1381: textAsString = captureText(); >> >> Is

Re: RFR: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage [v2]

2023-05-17 Thread Raffaello Giulietti
On Tue, 16 May 2023 13:29:26 GMT, Claes Redestad wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added some randomness in tests. > > src/java.base/share/classes/java/ut

Re: RFR: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage [v2]

2023-05-17 Thread Raffaello Giulietti
On Wed, 17 May 2023 05:24:28 GMT, Stuart Marks wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added some randomness in tests. > > src/java.base/share/classes/java/ut

<    1   2   3   4   5   6   >