Re: RFR: 8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle [v2]

2023-01-19 Thread Alan Bateman
On Thu, 19 Jan 2023 23:37:17 GMT, Mandy Chung wrote: >> `VarHandles.getStaticFieldFromBaseAndOffset` maps a base/offset/fieldType to >> a static `Field`. It's fragile to assume that the location of a static >> field returned by `Unsafe.staticFieldBase` is a Class object.This >> changes

Re: RFR: 8300693: Lower the compile threshold and reduce the iterations of warmup loop in VarHandles tests

2023-01-19 Thread David Holmes
On Thu, 19 Jan 2023 20:43:11 GMT, Mandy Chung wrote: > `java/lang/invoke/VarHandles` tests run with C1, C2 and tiered compilations > and the test cases are executed in the warm up loop with 2 iterations to > verify C1, C2 intrinsics. Default Tier4CompileThreshold is 15000. > > This PR

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-19 Thread Stuart Marks
On Fri, 20 Jan 2023 01:56:16 GMT, Stuart Marks wrote: >> Okay, I see your point and to use apiNote consistently would require >> "converting" some of the existing text to apiNote too. >> >> I'm still mulling over Pattern.compile throwing OOME. An implNote is >> probably the right category for

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-19 Thread Stuart Marks
On Thu, 19 Jan 2023 15:27:04 GMT, Raffaello Giulietti wrote: >> - Strengthen a computation that could overflow. >> - Specify that use of CANON_EQ could exhaust memory in the compilation phase. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-19 Thread Stuart Marks
On Tue, 17 Jan 2023 12:23:25 GMT, Alan Bateman wrote: >> The choice of a `` paragraph rather than `@apiNote` is for consistency >> with similar commentary paragraphs in the specs of `CASE_INSENSITIVE`, >> `UNICODE_CASE`, and `UNICODE_CHARACTER_CLASS`. >> >> I have no problems in using

Re: RFR: 8284493: Improve computeNextExponential tail performance and accuracy [v16]

2023-01-19 Thread Y . Srinivas Ramakrishna
On Tue, 4 Oct 2022 17:36:56 GMT, Chris Hennick wrote: >> This PR improves both the worst-case performance of `nextExponential` and >> `nextGaussian` and the distribution of output at the tails. It fixes the >> following imperfections: >> >> * Repeatedly adding

Re: RFR: 8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle [v2]

2023-01-19 Thread Mandy Chung
On Thu, 19 Jan 2023 23:01:23 GMT, Paul Sandoz wrote: >> Mandy Chung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> remove the base parameter which is unused > > src/java.base/share/classes/java/lang/invoke/VarHandles.java line 187: >

Re: RFR: 8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle [v2]

2023-01-19 Thread Paul Sandoz
On Thu, 19 Jan 2023 23:34:04 GMT, Mandy Chung wrote: >> `VarHandles.getStaticFieldFromBaseAndOffset` maps a base/offset/fieldType to >> a static `Field`. It's fragile to assume that the location of a static >> field returned by `Unsafe.staticFieldBase` is a Class object.This >> changes

Re: RFR: 8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle [v2]

2023-01-19 Thread Mandy Chung
> `VarHandles.getStaticFieldFromBaseAndOffset` maps a base/offset/fieldType to > a static `Field`. It's fragile to assume that the location of a static > field returned by `Unsafe.staticFieldBase` is a Class object.This changes > the VarHandle implementation for static fields (i.e.

Re: RFR: 8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat

2023-01-19 Thread Justin Lu
On Thu, 19 Jan 2023 23:20:52 GMT, Naoto Sato wrote: >> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for >> [java.text.CollationKey](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationKey.html) >> and >>

Re: RFR: 8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat

2023-01-19 Thread Naoto Sato
On Thu, 19 Jan 2023 22:25:51 GMT, Justin Lu wrote: > This PR implements _JEP 413: Code Snippets in Java API Documentation_ for > [java.text.CollationKey](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationKey.html) > and >

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread John R Rose
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat

2023-01-19 Thread Lance Andersen
On Thu, 19 Jan 2023 22:25:51 GMT, Justin Lu wrote: > This PR implements _JEP 413: Code Snippets in Java API Documentation_ for > [java.text.CollationKey](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationKey.html) > and >

Integrated: 8300586: Refactor code examples to use @snippet in java.text.Collator

2023-01-19 Thread Justin Lu
On Wed, 18 Jan 2023 19:36:51 GMT, Justin Lu wrote: > This PR implements _JEP 413: Code Snippets in Java API Documentation_ for > [java.text.Collator](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/Collator.html). > > Code examples using ... blocks are replaced with

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread Martin Buchholz
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Integrated: 8300356: Refactor code examples to use @snippet in java.text.CollationElementIterator

2023-01-19 Thread Justin Lu
On Tue, 17 Jan 2023 23:14:53 GMT, Justin Lu wrote: > This PR implements _JEP 413: Code Snippets in Java API Documentation_ for > [java.text.CollationElementIterator](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationElementIterator.html). > > Code examples using

RFR: 8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat

2023-01-19 Thread Justin Lu
This PR implements _JEP 413: Code Snippets in Java API Documentation_ for [java.text.CollationKey](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationKey.html) and

Integrated: JDK-8300698: Missing @since tag for ClassFileFormatVersion.RELEASE_21

2023-01-19 Thread Joe Darcy
On Thu, 19 Jan 2023 21:52:16 GMT, Joe Darcy wrote: > The addition of the new enum constant for ClassFileFormatVersion.RELEASE_21 > neglected to include an @since tag; this should be corrected. This pull request has now been integrated. Changeset: f2a1eb98 Author:Joe Darcy URL:

Re: RFR: JDK-8300698: Missing @since tag for ClassFileFormatVersion.RELEASE_21

2023-01-19 Thread Mandy Chung
On Thu, 19 Jan 2023 21:52:16 GMT, Joe Darcy wrote: > The addition of the new enum constant for ClassFileFormatVersion.RELEASE_21 > neglected to include an @since tag; this should be corrected. Marked as reviewed by mchung (Reviewer). - PR: https://git.openjdk.org/jdk/pull/12107

Re: RFR: JDK-8300698: Missing @since tag for ClassFileFormatVersion.RELEASE_21

2023-01-19 Thread Roger Riggs
On Thu, 19 Jan 2023 21:52:16 GMT, Joe Darcy wrote: > The addition of the new enum constant for ClassFileFormatVersion.RELEASE_21 > neglected to include an @since tag; this should be corrected. Marked as reviewed by rriggs (Reviewer). - PR: https://git.openjdk.org/jdk/pull/12107

RFR: JDK-8300698: Missing @since tag for ClassFileFormatVersion.RELEASE_21

2023-01-19 Thread Joe Darcy
The addition of the new enum constant for ClassFileFormatVersion.RELEASE_21 neglected to include an @since tag; this should be corrected. - Commit messages: - JDK-8300698: Missing @since tag for ClassFileFormatVersion.RELEASE_21 Changes:

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread fabioromano1
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

RFR: 8300693: Lower the compile threshold and reduce the iterations of warmup loop in VarHandles tests

2023-01-19 Thread Mandy Chung
`java/lang/invoke/VarHandles` tests run with C1, C2 and tiered compilations and the test cases are executed in the warm up loop with 2 iterations to verify C1, C2 intrinsics. Default Tier4CompileThreshold is 15000. This PR proposes to scale the compile threshold to 0.1 such that the warm

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread Martin Buchholz
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8284493: Improve computeNextExponential tail performance and accuracy [v16]

2023-01-19 Thread Chris Hennick
On Tue, 4 Oct 2022 17:36:56 GMT, Chris Hennick wrote: >> This PR improves both the worst-case performance of `nextExponential` and >> `nextGaussian` and the distribution of output at the tails. It fixes the >> following imperfections: >> >> * Repeatedly adding

Re: RFR: 8300236: Use VarHandle access in Data(Input | Output)Stream classes

2023-01-19 Thread Per Minborg
On Wed, 18 Jan 2023 16:34:57 GMT, Per Minborg wrote: > This PR proposes using a performance optimization using a new supported API > for operations similar to those found in `java.io.Bits` Performance looks promising for serialization (values in us/operation):   | Java 20 | Java 21 |

Re: RFR: 8300236: Use VarHandle access in Data(Input | Output)Stream classes

2023-01-19 Thread Roger Riggs
On Wed, 18 Jan 2023 16:34:57 GMT, Per Minborg wrote: > This PR proposes using a performance optimization using a new supported API > for operations similar to those found in `java.io.Bits` Some comments: src/java.base/share/classes/jdk/internal/util/Bits.java line 43: > 41: } > 42: >

RFR: 8300236: Use VarHandle access in Data(Input | Output)Stream classes

2023-01-19 Thread Per Minborg
This PR proposes using a performance optimization using a new supported API for operations similar to those found in `java.io.Bits` - Commit messages: - Remove white spaces - Remove white space - Fix jcheck issues - Update copyright years - Reformat javadoc - Prepare for

RFR: 8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle

2023-01-19 Thread Mandy Chung
`VarHandles.getStaticFieldFromBaseAndOffset` maps a base/offset/fieldType to a static `Field`. It's fragile to assume that the location of a static field returned by `Unsafe.staticFieldBase` is a Class object.This changes the VarHandle implementation for static fields (i.e.

ZIP entry copy without recompression

2023-01-19 Thread Eirik Bjørsnøs
Hi, A common use case for java.util.zip in build tools involves copying entries from a ZipFile or ZipInputStream to a ZipOutputStream without actually modifying the data. Example use cases include minification (make a JAR with only the reachable classes) and merging (combine several JAR files

Integrated: 8300647: Miscellaneous hashCode improvements in java.base

2023-01-19 Thread Claes Redestad
On Thu, 19 Jan 2023 11:45:12 GMT, Claes Redestad wrote: > Went through the jdk and found a few more places where > `ArraysSupport::vectorizedHashCode` can be used, and a few where adhoc > methods could be replaced with a plain call to `java.util.Arrays` > equivalents. This patch addresses

Re: RFR: 8300647: Miscellaneous hashCode improvements in java.base [v2]

2023-01-19 Thread Claes Redestad
On Thu, 19 Jan 2023 13:46:26 GMT, Claes Redestad wrote: >> Went through the jdk and found a few more places where >> `ArraysSupport::vectorizedHashCode` can be used, and a few where adhoc >> methods could be replaced with a plain call to `java.util.Arrays` >> equivalents. This patch addresses

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-19 Thread Raffaello Giulietti
On Tue, 17 Jan 2023 14:55:18 GMT, Raffaello Giulietti wrote: >> Okay, I see your point and to use apiNote consistently would require >> "converting" some of the existing text to apiNote too. >> >> I'm still mulling over Pattern.compile throwing OOME. An implNote is >> probably the right

Re: RFR: 8300647: Miscellaneous hashCode improvements in java.base [v2]

2023-01-19 Thread Roger Riggs
On Thu, 19 Jan 2023 13:46:26 GMT, Claes Redestad wrote: >> Went through the jdk and found a few more places where >> `ArraysSupport::vectorizedHashCode` can be used, and a few where adhoc >> methods could be replaced with a plain call to `java.util.Arrays` >> equivalents. This patch addresses

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-19 Thread Raffaello Giulietti
> - Strengthen a computation that could overflow. > - Specify that use of CANON_EQ could exhaust memory in the compilation phase. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: 8300207: Add a pre-check for the number of

Re: RFR: 8300647: Miscellaneous hashCode improvements in java.base [v2]

2023-01-19 Thread Sergey Tsypanov
On Thu, 19 Jan 2023 13:46:26 GMT, Claes Redestad wrote: >> Went through the jdk and found a few more places where >> `ArraysSupport::vectorizedHashCode` can be used, and a few where adhoc >> methods could be replaced with a plain call to `java.util.Arrays` >> equivalents. This patch addresses

Withdrawn: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder()

2023-01-19 Thread duke
On Wed, 17 Aug 2022 11:23:57 GMT, Sergey Tsypanov wrote: > We can use `Comparator.naturalOrder()` for cases when a `TreeMap` instance is > constructed without comparator. This allows to squash two branches in > `TreeMap.get()` into one. > > P.S. I think the comment of

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread fabioromano1
On Thu, 19 Jan 2023 14:03:38 GMT, fabioromano1 wrote: > Libraries cannot be all things to all users. A library provides a service > that would be difficult for a majority of users to implement on their own. > Sometimes a library needs specialization for certain use cases. That is why > we use

Re: RFR: 8300647: Miscellaneous hashCode improvements in java.base [v2]

2023-01-19 Thread Viktor Klang
On Thu, 19 Jan 2023 13:46:26 GMT, Claes Redestad wrote: >> Went through the jdk and found a few more places where >> `ArraysSupport::vectorizedHashCode` can be used, and a few where adhoc >> methods could be replaced with a plain call to `java.util.Arrays` >> equivalents. This patch addresses

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread fabioromano1
On Thu, 19 Jan 2023 13:24:03 GMT, Jim Laskey wrote: > Libraries cannot be all things to all users. A library provides a service > that would be difficult for a majority of users to implement on their own. > Sometimes a library needs specialization for certain use cases. That is why > we use

Re: RFR: 8300647: Miscellaneous hashCode improvements in java.base [v2]

2023-01-19 Thread Claes Redestad
> Went through the jdk and found a few more places where > `ArraysSupport::vectorizedHashCode` can be used, and a few where adhoc > methods could be replaced with a plain call to `java.util.Arrays` > equivalents. This patch addresses that. > > After this, #12068, and #12077 I think we're

Integrated: 8300119: CgroupMetrics.getTotalMemorySize0() can report invalid results on 32 bit systems

2023-01-19 Thread Jonathan Dowland
On Wed, 18 Jan 2023 13:20:06 GMT, Jonathan Dowland wrote: > This is a fix for https://bugs.openjdk.org/browse/JDK-8300119 > (CgroupMetrics.getTotalMemorySize0() can report invalid results on 32 bit > systems). Thanks to @jerboaa Severin Gehwolf for figuring out the solution. > > The problem

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread Jim Laskey
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread fabioromano1
On Wed, 18 Jan 2023 21:51:02 GMT, Martin Buchholz wrote: > Like other reviewers, changing the performance tradeoffs in BitSet make me > uncomfortable. > > 30 years of code has adapted to the current performance tradeoffs. Those > users who really need O(1) cardinality() can fairly easily

RFR: 8300647: Miscellaneous hashCode improvements in java.base

2023-01-19 Thread Claes Redestad
Went through the jdk and found a few more places where `ArraysSupport::vectorizedHashCode` can be used, and a few where adhoc methods could be replaced with a plain call to `java.util.Arrays` equivalents. This patch addresses that. After this, #12068, and #12077 I think we're reaching the

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

2023-01-19 Thread Claes Redestad
On Wed, 18 Jan 2023 16:53:04 GMT, Claes Redestad wrote: > `ZipCoder::checkedHashCode` emulates `StringLatin1::hashCode` but operates on > a `byte[]` subrange. It can profitably use the recently introduced > `ArraysSupport::vectorizedHashCode` method to see a speed-up, which > translates to a