Integrated: 8208077: File.listRoots performance degradation

2023-01-18 Thread Alan Bateman
On Wed, 18 Jan 2023 14:16:22 GMT, Alan Bateman wrote: > The Windows implementation of File.listRoots was changed in JDK 10 to test > the root directory of each "logical drive" to see that it exists. The motive > was to filter out drive letters corresponding to removable media where the > media

Re: RFR: 8293198: [vectorapi] Improve the implementation of VectorMask.indexInRange()

2023-01-18 Thread Xiaohong Gong
On Thu, 19 Jan 2023 03:51:28 GMT, Quan Anh Mai wrote: >> This "offset < 0" path can be optimized out by compiler if the "offset >= 0" >> in the common cases (i.e. normal loop with no tail loop). > > Yes but I don't think it is common enough to deserve special treatment. A > fast path should be

Re: RFR: 8293198: [vectorapi] Improve the implementation of VectorMask.indexInRange()

2023-01-18 Thread Quan Anh Mai
On Thu, 19 Jan 2023 03:45:43 GMT, Xiaohong Gong wrote: >> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java >> line 219: >> >>> 217: @ForceInline >>> 218: public VectorMask indexInRange(int offset, int limit) { >>> 219: if (offset < 0) { >> >> These

Re: RFR: 8293198: [vectorapi] Improve the implementation of VectorMask.indexInRange()

2023-01-18 Thread Xiaohong Gong
On Thu, 19 Jan 2023 03:37:33 GMT, Quan Anh Mai wrote: >> The Vector API `"indexInRange(int offset, int limit)"` is used >> to compute a vector mask whose lanes are set to true if the >> index of the lane is inside the range specified by the `"offset"` >> and `"limit"` arguments, otherwise the lan

Re: RFR: 8293198: [vectorapi] Improve the implementation of VectorMask.indexInRange()

2023-01-18 Thread Quan Anh Mai
On Wed, 18 Jan 2023 08:58:42 GMT, Xiaohong Gong wrote: > The Vector API `"indexInRange(int offset, int limit)"` is used > to compute a vector mask whose lanes are set to true if the > index of the lane is inside the range specified by the `"offset"` > and `"limit"` arguments, otherwise the lanes

Integrated: 8293841: RISC-V: Implementation of Foreign Function & Memory API (Preview)

2023-01-18 Thread Feilong Jiang
On Sat, 5 Nov 2022 03:48:01 GMT, Feilong Jiang wrote: > Add experimental Foreign Function & Memory API support for RISC-V. > > For details of the FFM API RISC-V port please refer to [JBS > issue](https://bugs.openjdk.org/browse/JDK-8293841) > > Testing: > > - [x] jdk_foreign with release/fast

Re: RFR: 8038146: Clarify Map.Entry's connection to the underlying map [v2]

2023-01-18 Thread Stuart Marks
On Sat, 14 Jan 2023 03:56:33 GMT, Stuart Marks wrote: >> Also additional verbiage regarding Map.Entry objects in general and their >> possible connection to an underlying Map. > > Stuart Marks has updated the pull request incrementally with one additional > commit since the last revision: > >

Re: RFR: 8293841: RISC-V: Implementation of Foreign Function & Memory API (Preview) [v5]

2023-01-18 Thread Feilong Jiang
On Sat, 14 Jan 2023 10:20:22 GMT, Jorn Vernee wrote: >> Feilong Jiang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix callArranger > > Marked as reviewed by jvernee (Reviewer). @JornVernee @RealFYang @shipilev @yadongw -- Thank you

Re: RFR: 8293841: RISC-V: Implementation of Foreign Function & Memory API (Preview) [v8]

2023-01-18 Thread Yadong Wang
On Wed, 18 Jan 2023 11:11:30 GMT, Feilong Jiang wrote: >> Add experimental Foreign Function & Memory API support for RISC-V. >> >> For details of the FFM API RISC-V port please refer to [JBS >> issue](https://bugs.openjdk.org/browse/JDK-8293841) >> >> Testing: >> >> - [x] jdk_foreign with rel

Re: RFR: 8292635: Run ArchivedEnumTest.java in jdk tier testing [v2]

2023-01-18 Thread Calvin Cheung
On Tue, 17 Jan 2023 18:58:15 GMT, Ioi Lam wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> enable CDSHeapVerifier::verify() for non-debug build > > LGTM Thanks @iklam and @dholmes-ora for the review.

Integrated: 8292635: Run ArchivedEnumTest.java in jdk tier testing

2023-01-18 Thread Calvin Cheung
On Fri, 13 Jan 2023 21:07:38 GMT, Calvin Cheung wrote: > Moving the `ArchivedEnumTest.java` from `runtime/cds/appcds/cacheObject` to > `jdk/internal/misc/CDS` so that the test will be run in jdk-tier1. This is to > avoid inadvertently breakage of the test like in JDK-8292499. > > Since jdk tie

Re: RFR: 8292635: Run ArchivedEnumTest.java in jdk tier testing [v2]

2023-01-18 Thread David Holmes
On Tue, 17 Jan 2023 17:40:33 GMT, Calvin Cheung wrote: >> Moving the `ArchivedEnumTest.java` from `runtime/cds/appcds/cacheObject` to >> `jdk/internal/misc/CDS` so that the test will be run in jdk-tier1. This is >> to avoid inadvertently breakage of the test like in JDK-8292499. >> >> Since jd

Integrated: Merge jdk20

2023-01-18 Thread Jesper Wilhelmsson
On Wed, 18 Jan 2023 21:56:13 GMT, Jesper Wilhelmsson wrote: > Forwardport JDK 20 -> JDK 21 This pull request has now been integrated. Changeset: fc9f8baf Author:Jesper Wilhelmsson URL: https://git.openjdk.org/jdk/commit/fc9f8baf56a362ad60d0e6dc8953690b80d3 Stats: 564 lines

Integrated: 8300308: java.text.MessageFormat has incorrect doc comment

2023-01-18 Thread Justin Lu
On Tue, 17 Jan 2023 22:44:29 GMT, Justin Lu wrote: > A code example for text.MessageFormat under the **Usage Information** section > has a comment with the wrong variable name. > > > * Object[] objs = mf.parse(forParsing, new ParsePosition(0)); > * // result now equals {new String("z")} > >

Integrated: 8300307: Refactor code examples to use @snippet in java.text.DateFormat

2023-01-18 Thread Justin Lu
On Tue, 17 Jan 2023 22:35:54 GMT, Justin Lu wrote: > This PR implements JEP 413: Code Snippets in Java API Documentation for > [java.text.DateFormat](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/DateFormat.html). > > Code examples using ... blocks are replaced with t

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

2023-01-18 Thread Naoto Sato
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 the

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v4]

2023-01-18 Thread Stuart Marks
On Sun, 15 Jan 2023 07:52:53 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conven

Integrated: JDK-8300594: Use generalized see and link tags in UnicastRemoteObject

2023-01-18 Thread Joe Darcy
On Wed, 18 Jan 2023 21:27:03 GMT, Joe Darcy wrote: > Use improved anchor syntax in UnicastRemoteObject. This pull request has now been integrated. Changeset: 601e0ae7 Author:Joe Darcy URL: https://git.openjdk.org/jdk/commit/601e0ae7da472acb68b53f766b30a688e6bacbcf Stats: 4 lines

Re: RFR: JDK-8300594: Use generalized see and link tags in UnicastRemoteObject

2023-01-18 Thread Stuart Marks
On Wed, 18 Jan 2023 21:27:03 GMT, Joe Darcy wrote: > Use improved anchor syntax in UnicastRemoteObject. Marked as reviewed by smarks (Reviewer). - PR: https://git.openjdk.org/jdk/pull/12083

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v4]

2023-01-18 Thread Tagir F . Valeev
On Sun, 15 Jan 2023 07:52:53 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conven

RFR: Merge jdk20

2023-01-18 Thread Jesper Wilhelmsson
Forwardport JDK 20 -> JDK 21 - Commit messages: - Merge remote-tracking branch 'jdk20/master' into Merge_jdk20 - 8300275: SegmentScope.isAccessibleBy returning incorrect values - 8300195: Fall-through issue occurs when using record pattern in switch statements - 8295723: security

Re: RFR: JDK-8300594: Use generalized see and link tags in UnicastRemoteObject

2023-01-18 Thread Roger Riggs
On Wed, 18 Jan 2023 21:27:03 GMT, Joe Darcy wrote: > Use improved anchor syntax in UnicastRemoteObject. LGTM - Marked as reviewed by rriggs (Reviewer). PR: https://git.openjdk.org/jdk/pull/12083

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

2023-01-18 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 >> wor

RFR: JDK-8300594: Use generalized see and link tags in UnicastRemoteObject

2023-01-18 Thread Joe Darcy
Use improved anchor syntax in UnicastRemoteObject. - Commit messages: - JDK-8300594: Use generalized see and link tags in UnicastRemoteObject Changes: https://git.openjdk.org/jdk/pull/12083/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12083&range=00 Issue: https://bugs.

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

2023-01-18 Thread Lance Andersen
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 the

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

2023-01-18 Thread Justin Lu
On Wed, 18 Jan 2023 21:07:01 GMT, Iris Clark wrote: >> The first `}` is for closing the else statement and the second `}` is for >> closing the `{snippet` > > I see that now! I didn't look up far enough. Thanks! No worries, thank you for reviewing! - PR: https://git.openjdk.org/

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

2023-01-18 Thread Iris Clark
On Wed, 18 Jan 2023 20:43:37 GMT, Justin Lu wrote: >> src/java.base/share/classes/java/text/Collator.java line 83: >> >>> 81: * System.out.println("abc is greater than or equal to ABC"); >>> 82: * } >>> 83: * } >> >> I don't think you need a second '}' here. > > The first `}` is for clos

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

2023-01-18 Thread Justin Lu
On Wed, 18 Jan 2023 20:19:03 GMT, Iris Clark 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 wit

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

2023-01-18 Thread Iris Clark
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 the

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

2023-01-18 Thread Justin Lu
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 the @ snippet syntax where applicable. Additionally, the code

Re: RFR: 8300356: Refactor code examples to use @snippet in java.text.CollationElementIterator [v3]

2023-01-18 Thread Naoto Sato
On Wed, 18 Jan 2023 19:02:36 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 usin

Re: RFR: 8300356: Refactor code examples to use @snippet in java.text.CollationElementIterator [v3]

2023-01-18 Thread Justin Lu
On Tue, 17 Jan 2023 23:55:41 GMT, Naoto Sato wrote: >> src/java.base/share/classes/java/text/CollationElementIterator.java line 87: >> >>> 85: * CollationElementIterator collationElementIterator = >>> ruleBasedCollator.getCollationElementIterator(testString); >>> 86: * int primaryOr

Re: RFR: 8300356: Refactor code examples to use @snippet in java.text.CollationElementIterator [v3]

2023-01-18 Thread Justin Lu
> 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 ... blocks are replaced with the @ snippet > syntax

Re: RFR: 8300356: Refactor code examples to use @snippet in java.text.CollationElementIterator [v3]

2023-01-18 Thread Justin Lu
On Tue, 17 Jan 2023 23:58:39 GMT, Naoto Sato wrote: >> Justin Lu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add unicode vertical ellipsis > > src/java.base/share/classes/java/text/CollationElementIterator.java line 82: > >> 80: *

Integrated: JDK-8300133: Use generalized see and link tags in core libs

2023-01-18 Thread Joe Darcy
On Fri, 13 Jan 2023 21:30:06 GMT, Joe Darcy wrote: > With generalized see and link tags that can refer to anchors (JDK-8200337), > the see and link tags in core libraries should be updated to use this feature > when possible. This PR covers such updates for java.base. This pull request has now

Re: RFR: JDK-8300133: Use generalized see and link tags in core libs [v2]

2023-01-18 Thread Stuart Marks
On Fri, 13 Jan 2023 22:54:47 GMT, Joe Darcy wrote: >> With generalized see and link tags that can refer to anchors (JDK-8200337), >> the see and link tags in core libraries should be updated to use this >> feature when possible. This PR covers such updates for java.base. > > Joe Darcy has updat

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

2023-01-18 Thread Alan Bateman
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 s

Re: RFR: 8300356: Refactor code examples to use @snippet in java.text.CollationElementIterator [v2]

2023-01-18 Thread Justin Lu
> 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 ... blocks are replaced with the @ snippet > syntax

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v4]

2023-01-18 Thread Stuart Marks
On Sun, 15 Jan 2023 07:52:53 GMT, Tagir F. Valeev wrote: >> Java 17 added RandomGenerator interface. However, existing method >> Collections.shuffle accepts old java.util.Random class. While since Java 19, >> it's possible to use Random.from(RandomGenerator) wrapper, it would be more >> conven

Re: RFR: 8292635: Run ArchivedEnumTest.java in jdk tier testing [v2]

2023-01-18 Thread Calvin Cheung
On Wed, 18 Jan 2023 02:19:04 GMT, David Holmes wrote: > I'm a bit confused. The JBS issue lists two things to do to improve > verification, but all this PR seems to do is move the test - in which case > the JBS issue should be updated. > We will only address item [2] in the bug description in

Re: RFR: 8300489: Use ArraysSupport.vectorizedHashCode in j.l.CharacterName

2023-01-18 Thread Claes Redestad
On Wed, 18 Jan 2023 11:04:57 GMT, Claes Redestad wrote: > This patch makes use of `ArraysSupport.vectorizedHashCode` and helps verify > the performance win also for range-based hash calculations. Also modernized > and cleaned up the surrounding code somewhat. > > > Benchmark

Integrated: 8300489: Use ArraysSupport.vectorizedHashCode in j.l.CharacterName

2023-01-18 Thread Claes Redestad
On Wed, 18 Jan 2023 11:04:57 GMT, Claes Redestad wrote: > This patch makes use of `ArraysSupport.vectorizedHashCode` and helps verify > the performance win also for range-based hash calculations. Also modernized > and cleaned up the surrounding code somewhat. > > > Benchmark

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

2023-01-18 Thread Claes Redestad
`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 small but significant speed-up on `ZipFile` creation. Before: Ben

Re: RFR: 8300489: Use ArraysSupport.vectorizedHashCode in j.l.CharacterName

2023-01-18 Thread Naoto Sato
On Wed, 18 Jan 2023 11:04:57 GMT, Claes Redestad wrote: > This patch makes use of `ArraysSupport.vectorizedHashCode` and helps verify > the performance win also for range-based hash calculations. Also modernized > and cleaned up the surrounding code somewhat. > > > Benchmark

Re: RFR: 8300208: Optimize Adler32 stub for AVX-512 targets.

2023-01-18 Thread Vladimir Kozlov
On Tue, 17 Jan 2023 17:24:20 GMT, Jatin Bhateja wrote: > Patch optimizes Adler32 stub for AVX512 target. > > Main computation loop now uses zero extended lane widening load vector > operation. > > New sequence also honors AVX3Thresholds so that implementation uses existing > AVX2 instruction

Re: RFR: 8300489: Use ArraysSupport.vectorizedHashCode in j.l.CharacterName

2023-01-18 Thread Alan Bateman
On Wed, 18 Jan 2023 11:04:57 GMT, Claes Redestad wrote: > This patch makes use of `ArraysSupport.vectorizedHashCode` and helps verify > the performance win also for range-based hash calculations. Also modernized > and cleaned up the surrounding code somewhat. > > > Benchmark

Re: RFR: 8208077: File.listRoots performance degradation

2023-01-18 Thread Brian Burkhalter
On Wed, 18 Jan 2023 14:16:22 GMT, Alan Bateman wrote: > The Windows implementation of File.listRoots was changed in JDK 10 to test > the root directory of each "logical drive" to see that it exists. The motive > was to filter out drive letters corresponding to removable media where the > media

Re: RFR: 8208077: File.listRoots performance degradation

2023-01-18 Thread Lance Andersen
On Wed, 18 Jan 2023 14:16:22 GMT, Alan Bateman wrote: > The Windows implementation of File.listRoots was changed in JDK 10 to test > the root directory of each "logical drive" to see that it exists. The motive > was to filter out drive letters corresponding to removable media where the > media

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v14]

2023-01-18 Thread Eirik Bjorsnos
On Wed, 18 Jan 2023 13:42:12 GMT, Eirik Bjorsnos wrote: >> When introducing the call to isInMetaInf in isSigningRelated, I accidentally >> broke the matching of MANIFEST.MF and SIG-* files. >> >> When fixing this regression, I now match against the full path instead of >> the existing prefix s

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v14]

2023-01-18 Thread Eirik Bjorsnos
> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that > files reside in META-INF directly, and not in a subdirectory of META-INF. > > The mentioned call sites needs updates to check and ignore such files. > > A new test VerifyUnrelatedSignatureFiles is added which verifies t

RFR: 8208077: File.listRoots performance degradation

2023-01-18 Thread Alan Bateman
The Windows implementation of File.listRoots was changed in JDK 10 to test the root directory of each "logical drive" to see that it exists. The motive was to filter out drive letters corresponding to removable media where the media is not present. This is problematic for a number of reasons tha

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

2023-01-18 Thread fabioromano1
On Wed, 18 Jan 2023 14:15:17 GMT, Uwe Schindler wrote: > As one dealing with bitsets very often: In my opinion, adding this to bitset > adds too much overhead on the hot methods like set/clear methods. Especially > loops that populate a BitSet with values, I am not sure if the whole loop can >

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

2023-01-18 Thread Uwe Schindler
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 >> wor

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

2023-01-18 Thread Uwe Schindler
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 >> wor

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

2023-01-18 Thread Claes Redestad
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 >> wor

Integrated: 8300237: Minor improvements in MethodHandles

2023-01-18 Thread Sergey Tsypanov
On Tue, 17 Jan 2023 08:22:28 GMT, Sergey Tsypanov wrote: > - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` > when we don't need a copy > - comparison of two lists can be done without `Stream.reduce()` This pull request has now been integrated. Changeset: 754f6e61 Au

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v13]

2023-01-18 Thread Eirik Bjorsnos
> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that > files reside in META-INF directly, and not in a subdirectory of META-INF. > > The mentioned call sites needs updates to check and ignore such files. > > A new test VerifyUnrelatedSignatureFiles is added which verifies t

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

2023-01-18 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 >> wor

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

2023-01-18 Thread Severin Gehwolf
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 is

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

2023-01-18 Thread Alan Bateman
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 >> wor

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v12]

2023-01-18 Thread Eirik Bjorsnos
> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that > files reside in META-INF directly, and not in a subdirectory of META-INF. > > The mentioned call sites needs updates to check and ignore such files. > > A new test VerifyUnrelatedSignatureFiles is added which verifies t

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v11]

2023-01-18 Thread Eirik Bjorsnos
On Wed, 18 Jan 2023 12:57:17 GMT, Eirik Bjorsnos wrote: >> I agree this deserves a cleanup, and since we're already deep into it it can >> make sense to fix this in this PR. >> >> I have introduced SignatureFileVerifier.isInMetaInf as a common method to >> replace duplicated logic in JarVerifi

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread Simon Tooke
On Wed, 11 Jan 2023 16:02:40 GMT, Sergey Kuksenko wrote: > It would be better to see benchmark results other than cardinality operation. > To understand how big performance regression is. Agreed - I suspect this is adding unnecessary overhead to the most common uses of BitSet; I'd be tempted t

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

2023-01-18 Thread Jonathan Dowland
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 is demonstrated by test/hotspot/jtreg/containers/docker/TestMemoryAware

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

2023-01-18 Thread fabioromano1
> 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 > words in use by the bit set. > This optimization reduces the co

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v11]

2023-01-18 Thread Eirik Bjorsnos
On Wed, 18 Jan 2023 09:51:35 GMT, Eirik Bjorsnos wrote: >> While `JarSigner` has not normalize to uppercase, the check is the same. As >> for `/META-INF/`, it must be very broken now since >> `JarFile::maybeInstantiateVerifier` is using >> `JUZFA.getManifestName(this,true)` to read the manifes

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v11]

2023-01-18 Thread Eirik Bjorsnos
> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that > files reside in META-INF directly, and not in a subdirectory of META-INF. > > The mentioned call sites needs updates to check and ignore such files. > > A new test VerifyUnrelatedSignatureFiles is added which verifies t

[jdk20] Integrated: 8300275: SegmentScope.isAccessibleBy returning incorrect values

2023-01-18 Thread Maurizio Cimadamore
On Tue, 17 Jan 2023 18:30:16 GMT, Maurizio Cimadamore wrote: > The implementation of MemorySessionImpl::isAccessibleBy is incorrect, and > ends up always returning `false` for scopes associated with shared arenas. > This patch rectifies that, and adds some tests. This pull request has now been

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

2023-01-18 Thread fabioromano1
On Wed, 18 Jan 2023 11:37:05 GMT, Alan Bateman wrote: > It looks all the javadoc and several areas of the code have been > re-formatted. Please revert all of this as it's impossible to see what has > been changed. Done. - PR: https://git.openjdk.org/jdk/pull/11837

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

2023-01-18 Thread fabioromano1
> 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 > words in use by the bit set. > This optimization reduces the co

Re: [jdk20] RFR: 8300275: SegmentScope.isAccessibleBy returning incorrect values [v2]

2023-01-18 Thread Maurizio Cimadamore
> The implementation of MemorySessionImpl::isAccessibleBy is incorrect, and > ends up always returning `false` for scopes associated with shared arenas. > This patch rectifies that, and adds some tests. Maurizio Cimadamore has updated the pull request incrementally with one additional commit sin

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

2023-01-18 Thread fabioromano1
> 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 > words in use by the bit set. > This optimization reduces the co

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

2023-01-18 Thread Alan Bateman
On Wed, 18 Jan 2023 11:31:23 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 >> wor

Re: [jdk20] RFR: 8300275: SegmentScope.isAccessibleBy returning incorrect values

2023-01-18 Thread Jorn Vernee
On Tue, 17 Jan 2023 18:30:16 GMT, Maurizio Cimadamore wrote: > The implementation of MemorySessionImpl::isAccessibleBy is incorrect, and > ends up always returning `false` for scopes associated with shared arenas. > This patch rectifies that, and adds some tests. Marked as reviewed by jvernee

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

2023-01-18 Thread fabioromano1
> 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 > words in use by the bit set. > This optimization reduces the co

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread fabioromano1
On Wed, 11 Jan 2023 15:33:47 GMT, Claes Redestad wrote: >> I agree with the fact that is less intrusive, but certainly not potentially >> quicker, since the complete recalculation of cardinality requires linear >> time in the value of wordsInUse > > A perhaps slightly less racy way would be to

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread Claes Redestad
On Wed, 11 Jan 2023 13:23:44 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/util/BitSet.java line 421: >> >>> 419: final long bitMask = 1L << bitIndex; >>> 420: words[wordIndex] ^= bitMask; >>> 421: cardinality += (words[wordIndex] & bitMask) != 0 ? 1 : -1;

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread fabioromano1
On Wed, 11 Jan 2023 12:57:47 GMT, Jim Laskey 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 >> words

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread Jim Laskey
On Tue, 3 Jan 2023 23:25:39 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 > words in

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread fabioromano1
On Wed, 18 Jan 2023 06:36:56 GMT, Julian Waters wrote: > @fabioromano1 Would you like me to create an entry for you for the Pull > Request is linked to the appropriate mailing list? When I do that you will > have to change the name of this Pull Request though Yes, thank you very much. ---

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread Julian Waters
On Tue, 3 Jan 2023 23:25:39 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 > words in

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread Sergey Kuksenko
On Tue, 3 Jan 2023 23:25:39 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 > words in

Re: RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread Simon Tooke
On Tue, 3 Jan 2023 23:25:39 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 > words in

RFR: 8300487: Store cardinality as a field in BitSet

2023-01-18 Thread fabioromano1
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 words in use by the bit set. This optimization reduces the cost of call

RFR: 8300489: Use ArraysSupport.vectorizedHashCode in j.l.CharacterName

2023-01-18 Thread Claes Redestad
This patch makes use of `ArraysSupport.vectorizedHashCode` and helps verify the performance win also for range-based hash calculations. Also modernized and cleaned up the surrounding code somewhat. Benchmark Mode CntScore Error Units Characters.CodePoints.codeP

Re: RFR: 8293841: RISC-V: Implementation of Foreign Function & Memory API (Preview) [v8]

2023-01-18 Thread Feilong Jiang
> Add experimental Foreign Function & Memory API support for RISC-V. > > For details of the FFM API RISC-V port please refer to [JBS > issue](https://bugs.openjdk.org/browse/JDK-8293841) > > Testing: > > - [x] jdk_foreign with release/fastdebug build on linux-riscv64 > - [x] jdk_foreign with re

Integrated: 8300169: Build failure with clang-15

2023-01-18 Thread Jie Fu
On Sat, 14 Jan 2023 14:28:32 GMT, Jie Fu wrote: > Hi all, > > Please review the fix for the build failure with clang-15. > > 1. -Wbitwise-instead-of-logical > >1) src/hotspot/share/oops/generateOopMap.cpp <--- fixed the > warning >2) src/hotspot/share/runtime/notificationThre

Re: [jdk20] RFR: 8300275: SegmentScope.isAccessibleBy returning incorrect values

2023-01-18 Thread Alan Bateman
On Tue, 17 Jan 2023 18:30:16 GMT, Maurizio Cimadamore wrote: > The implementation of MemorySessionImpl::isAccessibleBy is incorrect, and > ends up always returning `false` for scopes associated with shared arenas. > This patch rectifies that, and adds some tests. Looks okay to me, surprised it

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v10]

2023-01-18 Thread Eirik Bjorsnos
> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that > files reside in META-INF directly, and not in a subdirectory of META-INF. > > The mentioned call sites needs updates to check and ignore such files. > > A new test VerifyUnrelatedSignatureFiles is added which verifies t

Re: RFR: 8300237: Minor improvements in MethodHandles [v5]

2023-01-18 Thread Claes Redestad
On Wed, 18 Jan 2023 07:32:58 GMT, Sergey Tsypanov wrote: >> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` >> when we don't need a copy >> - comparison of two lists can be done without `Stream.reduce()` > > Sergey Tsypanov has updated the pull request incrementally w

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v9]

2023-01-18 Thread Eirik Bjorsnos
> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that > files reside in META-INF directly, and not in a subdirectory of META-INF. > > The mentioned call sites needs updates to check and ignore such files. > > A new test VerifyUnrelatedSignatureFiles is added which verifies t

Re: RFR: 8300237: Minor improvements in MethodHandles [v5]

2023-01-18 Thread Rémi Forax
On Wed, 18 Jan 2023 07:32:58 GMT, Sergey Tsypanov wrote: >> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` >> when we don't need a copy >> - comparison of two lists can be done without `Stream.reduce()` > > Sergey Tsypanov has updated the pull request incrementally w

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v8]

2023-01-18 Thread Eirik Bjorsnos
> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that > files reside in META-INF directly, and not in a subdirectory of META-INF. > > The mentioned call sites needs updates to check and ignore such files. > > A new test VerifyUnrelatedSignatureFiles is added which verifies t

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v7]

2023-01-18 Thread Eirik Bjorsnos
On Tue, 17 Jan 2023 16:11:42 GMT, Weijun Wang wrote: >> This duplicated check annoyed me also, but the existing checks have >> different behavior: >> >> - JarVerifier.beginEntry normalizes the path to uppercase, them checks that >> it starts with "META-INF/" or "/META-INF/" >> - JarSigner.sign

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v7]

2023-01-18 Thread Eirik Bjorsnos
On Wed, 18 Jan 2023 09:47:29 GMT, Eirik Bjorsnos wrote: >> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that >> files reside in META-INF directly, and not in a subdirectory of META-INF. >> >> The mentioned call sites needs updates to check and ignore such files. >> >> A

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v7]

2023-01-18 Thread Eirik Bjorsnos
On Tue, 17 Jan 2023 16:46:28 GMT, Weijun Wang wrote: >> I started there, but ran into some problems: >> >> SignatureFileVerifier.isSigningRelated calls isBlockOrSF, but it removes the >> "META-INF/" prefix from the path first. So we can't assume that input to >> isBlockOrSF is the full path. >

Re: RFR: 8300140: ZipFile.isSignatureRelated returns true for files in META-INF subdirectories [v7]

2023-01-18 Thread Eirik Bjorsnos
> Some call sites of SignatureFileVerifier.isBlockOrSF fails to check that > files reside in META-INF directly, and not in a subdirectory of META-INF. > > The mentioned call sites needs updates to check and ignore such files. > > A new test VerifyUnrelatedSignatureFiles is added which verifies t

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v22]

2023-01-18 Thread Claes Redestad
On Tue, 17 Jan 2023 21:06:01 GMT, Claes Redestad wrote: >> Continuing the work initiated by @luhenry to unroll and then intrinsify >> polynomial hash loops. >> >> I've rewired the library changes to route via a single `@IntrinsicCandidate` >> method. To make this work I've harmonized how they

RFR: 8293198: [vectorapi] Improve the implementation of VectorMask.indexInRange()

2023-01-18 Thread Xiaohong Gong
The Vector API `"indexInRange(int offset, int limit)"` is used to compute a vector mask whose lanes are set to true if the index of the lane is inside the range specified by the `"offset"` and `"limit"` arguments, otherwise the lanes are set to false. There are two special cases for this API: 1)

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v22]

2023-01-18 Thread Ludovic Henry
On Tue, 17 Jan 2023 21:06:01 GMT, Claes Redestad wrote: >> Continuing the work initiated by @luhenry to unroll and then intrinsify >> polynomial hash loops. >> >> I've rewired the library changes to route via a single `@IntrinsicCandidate` >> method. To make this work I've harmonized how they

  1   2   >