Re: RFR: 8308753: Class-File API transition to Preview [v32]

2023-11-29 Thread Per Minborg
On Tue, 28 Nov 2023 13:03:48 GMT, Adam Sotona wrote: >> src/java.base/share/classes/java/lang/classfile/ClassFile.java line 1404: >> >>> (failed to retrieve contents of file, check the PR for context) >> Is there a more scalable way to express the major class version? The current >> approach me

Integrated: 8320858: Move jpackage tests to tier3

2023-11-29 Thread Alan Bateman
On Tue, 28 Nov 2023 08:51:17 GMT, Alan Bateman wrote: > Update the jtreg test group configuration in the jdk test tree so that the > jpackage tests run in tier3 rather than tier2. > > At this time, the jpackage tests run in jdk:tier2, more specifically > jdk:tier2_part2 as part of the core_too

Re: RFR: JDK-8320940: Fix typo in java.lang.Double

2023-11-29 Thread Aleksey Shipilev
On Wed, 29 Nov 2023 02:00:14 GMT, Joe Darcy wrote: > Typo fix to to the new text added in JDK-8295391. Marked as reviewed by shade (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/16872#pullrequestreview-1754814207

Re: RFR: JDK-8320940: Fix typo in java.lang.Double

2023-11-29 Thread Lance Andersen
On Wed, 29 Nov 2023 02:00:14 GMT, Joe Darcy wrote: > Typo fix to to the new text added in JDK-8295391. Marked as reviewed by lancea (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/16872#pullrequestreview-1755023783

RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Sergey Tsypanov
It looks like we can skip copying of `byte[]` in `BufferedInputStream.implTransferTo()` for `OutputStreams` residing in `java.io`. See comment by @vlsi in https://github.com/openjdk/jdk/pull/10525/files#diff-e19c508d1bb6ee78697ecca66947c395adda0d9c49a85bf696e677ecbd977af1R612 - Co

Re: RFR: 8310644: Make panama memory segment close use async handshakes [v3]

2023-11-29 Thread Erik Österlund
On Thu, 23 Nov 2023 16:32:28 GMT, Jorn Vernee wrote: >> Erik Österlund has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Comments from Jorn > > LGTM Thanks for the reviews @JornVernee @pchilano and @mcimadamore! - PR Comment

Integrated: 8310644: Make panama memory segment close use async handshakes

2023-11-29 Thread Erik Österlund
On Thu, 23 Nov 2023 11:14:29 GMT, Erik Österlund wrote: > The current logic for closing memory in panama today is susceptible to live > lock if we have a closing thread that wants to close the memory in a loop > that keeps failing, and a bunch of accessing threads that want to perform > access

Unneeded array assignments in core libs

2023-11-29 Thread Anthony Goubard
Hello, Last Friday, I decided to look if there were some classes that did unneeded array assignments (e.g. to 0 / 0.0f / null / false) in the JDK. I've found a few places and in particular 2 places where it's done in big for loops (looping more than 500 times). So I thought you might be interes

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Vladimir Sitnikov
On Wed, 29 Nov 2023 11:57:37 GMT, Sergey Tsypanov wrote: > It looks like we can skip copying of `byte[]` in > `BufferedInputStream.implTransferTo()` for `OutputStreams` residing in > `java.io`. > > See comment by @vlsi in > https://github.com/openjdk/jdk/pull/10525/files#diff-e19c508d1bb6ee78

Re: RFR: 8311302: Allow for jlinking a custom runtime without packaged modules being present [v10]

2023-11-29 Thread Severin Gehwolf
On Fri, 24 Nov 2023 13:25:35 GMT, Severin Gehwolf wrote: >> Please review this patch which adds a "jmodless" jlink mode to the JDK. >> Fundamentally this patch adds an option to use `jlink` even though your JDK >> install might not come with the packaged modules (directory `jmods`). This >> is

Re: RFR: JDK-8315458 Implement JEP 463: Implicitly Declared Classes and Instance Main Method (Second Preview) [v42]

2023-11-29 Thread Jim Laskey
> Address changes from JEP 445 to JEP 463. > > - Move from a SYNTHETIC unnamed class to a MANDATED implicit class. > > - Don't mark class on read. > > - Remove reflection and annotation processing related to unnamed classes. > > - Simplify main method search. Jim Laskey has updated the pull re

Re: RFR: JDK-8315458 Implement JEP 463: Implicitly Declared Classes and Instance Main Method (Second Preview) [v42]

2023-11-29 Thread Jan Lahoda
On Wed, 29 Nov 2023 14:30:50 GMT, Jim Laskey wrote: >> Address changes from JEP 445 to JEP 463. >> >> - Move from a SYNTHETIC unnamed class to a MANDATED implicit class. >> >> - Don't mark class on read. >> >> - Remove reflection and annotation processing related to unnamed classes. >> >> - S

Re: RFR: JDK-8320448 Accelerate IndexOf using AVX2 [v2]

2023-11-29 Thread Scott Gibbons
> Re-write the IndexOf code without the use of the pcmpestri instruction, only > using AVX2 instructions. This change accelerates String.IndexOf on average > 1.3x for AVX2. The benchmark numbers: > > > BenchmarkScore > Latest

Re: RFR: JDK-8315458 Implement JEP 463: Implicitly Declared Classes and Instance Main Method (Second Preview) [v43]

2023-11-29 Thread Jim Laskey
> Address changes from JEP 445 to JEP 463. > > - Move from a SYNTHETIC unnamed class to a MANDATED implicit class. > > - Don't mark class on read. > > - Remove reflection and annotation processing related to unnamed classes. > > - Simplify main method search. Jim Laskey has updated the pull re

Re: RFR: JDK-8320940: Fix typo in java.lang.Double

2023-11-29 Thread Brian Burkhalter
On Wed, 29 Nov 2023 02:00:14 GMT, Joe Darcy wrote: > Typo fix to to the new text added in JDK-8295391. Marked as reviewed by bpb (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/16872#pullrequestreview-1755813777

Integrated: JDK-8320940: Fix typo in java.lang.Double

2023-11-29 Thread Joe Darcy
On Wed, 29 Nov 2023 02:00:14 GMT, Joe Darcy wrote: > Typo fix to to the new text added in JDK-8295391. This pull request has now been integrated. Changeset: d783aa31 Author:Joe Darcy URL: https://git.openjdk.org/jdk/commit/d783aa31a9c20f5ac2ee52c55bdc9be2388b1705 Stats: 1 line i

Re: RFR: 8318966: Some methods make promises about Java array element alignment that are too strong

2023-11-29 Thread Jorn Vernee
On Wed, 15 Nov 2023 22:46:03 GMT, Jorn Vernee wrote: > See the JBS issue for an extended problem description. > > This patch changes the specification and implementation of > `MethodHandles::byteArrayViewVarHandle`, > `MethodHandles::byteBufferViewVarHandle`, `ByteBuffer::alignedSlice`, and >

Re: RFR: JDK-8320448 Accelerate IndexOf using AVX2 [v2]

2023-11-29 Thread Scott Gibbons
On Wed, 29 Nov 2023 15:01:32 GMT, Scott Gibbons wrote: >> Re-write the IndexOf code without the use of the pcmpestri instruction, only >> using AVX2 instructions. This change accelerates String.IndexOf on average >> 1.3x for AVX2. The benchmark numbers: >> >> >> Benchmark

Re: RFR: JDK-8319413: Start of release updates for JDK 23 [v2]

2023-11-29 Thread Joe Darcy
> Time to start making preparations for JDK 23. Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: - Merge branch 'master' into JDK-8319413 - Add symbol files for JDK 22 build 25. - Merge branch 'master' into

Integrated: JDK-8210410: Refactor java.util.Currency:i18n shell tests to plain java tests

2023-11-29 Thread Justin Lu
On Thu, 23 Nov 2023 00:26:43 GMT, Justin Lu wrote: > Please review this PR which converts the shell test, > _java/util/currency/PropertiesTest.sh_ to a normal java test. > > This test is a test runner that launches test methods from > _PropertiesTest.java_. It tests both the ways to supersede

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Alan Bateman
On Wed, 29 Nov 2023 13:56:34 GMT, Vladimir Sitnikov wrote: > What do you think of passing the buffer as is? No, it should only do for trusted targets. BAIS has an issue in that area that should be fixed. - PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1409

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Alan Bateman
On Wed, 29 Nov 2023 11:57:37 GMT, Sergey Tsypanov wrote: > It looks like we can skip copying of `byte[]` in > `BufferedInputStream.implTransferTo()` for `OutputStreams` residing in > `java.io`. > > See comment by @vlsi in > https://github.com/openjdk/jdk/pull/10525/files#diff-e19c508d1bb6ee78

Re: RFR: 8320716: ResolvedModule::reads includes self when configuration contains two or more automatic modules

2023-11-29 Thread Mandy Chung
On Sun, 26 Nov 2023 18:18:10 GMT, Alan Bateman wrote: > This is update to the specification of the j.l.module.ResolvedModule.reads > method to clarify that the set of resolved modules returned does not include > itself. There is a small implementation change to align with the > specification a

Re: RFR: JDK-8315458 Implement JEP 463: Implicitly Declared Classes and Instance Main Method (Second Preview) [v43]

2023-11-29 Thread Joe Darcy
On Wed, 29 Nov 2023 15:25:15 GMT, Jim Laskey wrote: >> Address changes from JEP 445 to JEP 463. >> >> - Move from a SYNTHETIC unnamed class to a MANDATED implicit class. >> >> - Don't mark class on read. >> >> - Remove reflection and annotation processing related to unnamed classes. >> >> - S

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Vladimir Sitnikov
On Wed, 29 Nov 2023 19:55:09 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/io/BufferedInputStream.java line 653: >> >>> 651: byte[] buffer = Arrays.copyOfRange(getBufIfOpen(), >>> pos, count); >>> 652: out.write(buffer); >>> 653:

Re: RFR: JDK-8315458 Implement JEP 463: Implicitly Declared Classes and Instance Main Method (Second Preview) [v43]

2023-11-29 Thread Joe Darcy
On Wed, 29 Nov 2023 15:25:15 GMT, Jim Laskey wrote: >> Address changes from JEP 445 to JEP 463. >> >> - Move from a SYNTHETIC unnamed class to a MANDATED implicit class. >> >> - Don't mark class on read. >> >> - Remove reflection and annotation processing related to unnamed classes. >> >> - S

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Alan Bateman
On Wed, 29 Nov 2023 20:07:37 GMT, Vladimir Sitnikov wrote: > The buffer in question is protected, so any subclass can directly access it. > In other words, untrusted code can easily acoess the buffer, and it does not > sound fair to add extra overhead to the method which was created for the >

Re: RFR: JDK-8315458 Implement JEP 463: Implicitly Declared Classes and Instance Main Method (Second Preview) [v35]

2023-11-29 Thread Joe Darcy
On Tue, 28 Nov 2023 15:00:43 GMT, Jim Laskey wrote: >> test/langtools/tools/javac/ImplicitClass/TestImplicitClass.java line 35: >> >>> 33: import java.lang.reflect.Modifier; >>> 34: >>> 35: public class TestImplicitClass { >> >> The test looks to be testing core reflection behavior (i.e. runti

Re: Unneeded array assignments in core libs

2023-11-29 Thread Roger Riggs
Hi Anthony, Go ahead a file a single bug (for the two cases). That code may have been written before Arrays.fill(...). Regards, Roger On 11/29/23 7:54 AM, Anthony Goubard wrote: Hello,  Last Friday, I decided to look if there were some classes that did unneeded array assignments (e.g. to 0 /

Re: Unneeded array assignments in core libs

2023-11-29 Thread Anthony Goubard
Thanks for the answers. I've created an issue in bugreport.java.com with internal review ID : 9076287 Hope that helps, Anthony Le mer. 29 nov. 2023 à 21:55, Roger Riggs a écrit : > Hi Anthony, > > Go ahead a file a single bug (for the two cases). > That code may have been written before Arrays.

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Markus KARG
On Wed, 29 Nov 2023 20:07:37 GMT, Vladimir Sitnikov wrote: >>> What do you think of passing the buffer as is? >> >> No, it should only do for trusted targets. BAIS has an issue in that area >> that should be fixed. > > The buffer in question is protected, so any subclass can directly access it

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Markus KARG
On Wed, 29 Nov 2023 11:57:37 GMT, Sergey Tsypanov wrote: > It looks like we can skip copying of `byte[]` in > `BufferedInputStream.implTransferTo()` for `OutputStreams` residing in > `java.io`. > > See comment by @vlsi in > https://github.com/openjdk/jdk/pull/10525/files#diff-e19c508d1bb6ee78

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Markus KARG
On Wed, 29 Nov 2023 19:59:03 GMT, Alan Bateman wrote: >> It looks like we can skip copying of `byte[]` in >> `BufferedInputStream.implTransferTo()` for `OutputStreams` residing in >> `java.io`. >> >> See comment by @vlsi in >> https://github.com/openjdk/jdk/pull/10525/files#diff-e19c508d1bb6e

RFR: 6230751: [Fmt-Ch] Recursive MessageFormats in ChoiceFormats ignore indicated subformats

2023-11-29 Thread Justin Lu
Please review this PR which updates an incorrect code example in _java/text/ChoiceFormat_. ChoiceFormat (and MessageFormat) provide an example of how to produce a pattern that supports singular and plural forms. The ChoiceFormat example is incorrect, as recursive MessageFormats produced by a Ch

Re: RFR: 8294696 - BufferedInputStream.transferTo should drain buffer when mark set [v6]

2023-11-29 Thread Markus KARG
On Wed, 29 Nov 2023 22:49:17 GMT, Markus KARG wrote: >> Buffer copy was not there before, and defensive copy was never present in >> `ByteArrayInputStream` as well: >> https://github.com/openjdk/jdk/blob/9a6ca233c7e91ffa2ce9451568b3be88ccd04504/src/java.base/share/classes/java/io/ByteArrayInput

Re: RFR: 8294696 - BufferedInputStream.transferTo should drain buffer when mark set [v6]

2023-11-29 Thread Markus KARG
On Wed, 29 Nov 2023 05:55:03 GMT, Vladimir Sitnikov wrote: >> src/java.base/share/classes/java/io/BufferedInputStream.java line 612: >> >>> 610: if (avail > 0) { >>> 611: // Prevent poisoning and leaking of buf >>> 612: byte[] buffer = Arrays.copyOfRa

Re: RFR: 8294696 - BufferedInputStream.transferTo should drain buffer when mark set [v6]

2023-11-29 Thread Brian Burkhalter
On Wed, 29 Nov 2023 22:49:58 GMT, Markus KARG wrote: > As Alan pointed out, it is a bug (actually even a security risk), so BAIS > should get fixed, too. I am going to file an issue on this. - PR Review Comment: https://git.openjdk.org/jdk/pull/10525#discussion_r1409965074

Re: RFR: 6230751: [Fmt-Ch] Recursive MessageFormats in ChoiceFormats ignore indicated subformats

2023-11-29 Thread Naoto Sato
On Wed, 29 Nov 2023 22:41:26 GMT, Justin Lu wrote: > Please review this PR which updates an incorrect code example in > _java/text/ChoiceFormat_. > > ChoiceFormat (and MessageFormat) provide an example of how to produce a > pattern that supports singular and plural forms. The ChoiceFormat exam

Re: RFR: 8314480: Memory ordering spec updates in java.lang.ref

2023-11-29 Thread Brent Christian
On Tue, 21 Nov 2023 09:12:49 GMT, Viktor Klang wrote: >> Classes in the `java.lang.ref` package would benefit from an update to bring >> the spec in line with how the VM already behaves. The changes would focus on >> _happens-before_ edges at some key points during reference processing. >> >>

Re: RFR: 8311302: Allow for jlinking a custom runtime without packaged modules being present [v10]

2023-11-29 Thread Mandy Chung
On Fri, 24 Nov 2023 13:25:35 GMT, Severin Gehwolf wrote: >> Please review this patch which adds a "jmodless" jlink mode to the JDK. >> Fundamentally this patch adds an option to use `jlink` even though your JDK >> install might not come with the packaged modules (directory `jmods`). This >> is

RFR: 8321053: Use ByteArrayInputStream.buf directly when parameter of transferTo() is trusted

2023-11-29 Thread Brian Burkhalter
Pass `ByteArrayInputStream.buf ` directly to the `OutputStream` parameter of `BAIS.transferTo` only if the target stream is in the `java.io` package. - Commit messages: - 8321053: Use ByteArrayInputStream.buf directly when parameter of transferTo() is trusted Changes: https://git.

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread Brian Burkhalter
On Wed, 29 Nov 2023 11:57:37 GMT, Sergey Tsypanov wrote: > It looks like we can skip copying of `byte[]` in > `BufferedInputStream.implTransferTo()` for `OutputStreams` residing in > `java.io`. > > See comment by @vlsi in > https://github.com/openjdk/jdk/pull/10525/files#diff-e19c508d1bb6ee78

Re: RFR: 6230751: [Fmt-Ch] Recursive MessageFormats in ChoiceFormats ignore indicated subformats

2023-11-29 Thread Justin Lu
On Wed, 29 Nov 2023 23:34:14 GMT, Naoto Sato wrote: > Do you think it would be helpful if we describe that limitation so that such > confusion will not arise? Yes, that's a good point. I didn't initially include one because I wanted to look into [JDK-4270867](https://bugs.openjdk.org/browse/JD

Re: RFR: 8314480: Memory ordering spec updates in java.lang.ref

2023-11-29 Thread Brent Christian
On Tue, 21 Nov 2023 22:46:32 GMT, Roger Riggs wrote: >> src/java.base/share/classes/java/lang/ref/Reference.java line 489: >> >>> 487: * If this reference was already enqueued (by the garbage >>> collector, or a >>> 488: * previous call to {@code enqueue}), this method is not >>> suc

Re: RFR: 8319872: AArch64: [vectorapi] Implementation of unsigned (zero extended) casts [v4]

2023-11-29 Thread Eric Liu
On Wed, 22 Nov 2023 07:05:21 GMT, Eric Liu wrote: >> Vector API defines zero-extend operations [1], which are going to be >> intrinsified and generated to `VectorUCastNode` by C2. This patch adds >> backend implementation for `VectorUCastNode` on AArch64. >> >> The micro benchmark shows signif

Re: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v2]

2023-11-29 Thread Sandhya Viswanathan
On Tue, 28 Nov 2023 20:52:35 GMT, Srinivas Vamsi Parasa wrote: >> Thanks Sandhya, will fix this issue. > > Thanks Sandhya for suggesting the change to use supports_simd_sort(BasicType > bt). Please see the updated code upstreamed. @vamsi-parasa Thanks, your changes look good to me. --

Re: RFR: 8321053: Use ByteArrayInputStream.buf directly when parameter of transferTo() is trusted

2023-11-29 Thread jmehrens
On Thu, 30 Nov 2023 00:03:21 GMT, Brian Burkhalter wrote: > Pass `ByteArrayInputStream.buf ` directly to the `OutputStream` parameter of > `BAIS.transferTo` only if the target stream is in the `java.io` package. src/java.base/share/classes/java/io/ByteArrayInputStream.java line 211: > 209:

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted

2023-11-29 Thread jmehrens
On Wed, 29 Nov 2023 22:38:59 GMT, Markus KARG wrote: >> src/java.base/share/classes/java/io/BufferedInputStream.java line 647: >> >>> 645: if (avail > 0) { >>> 646: // trust all OutputStreams from java.io >>> 647: if (out.getClass().getPackageName() ==

Re: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5]

2023-11-29 Thread Xiaohong Gong
> Currently the vector floating-point math APIs like > `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, > which causes large performance gap on AArch64. Note that those APIs are > optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. > To close th

Re: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v4]

2023-11-29 Thread Xiaohong Gong
On Thu, 23 Nov 2023 14:05:51 GMT, Magnus Ihse Bursie wrote: >> Xiaohong Gong has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Address review comments in build system > > make/autoconf/lib-vmath.m4 line 70: > >> 68: if test "x$SYS