Re: RFR: 8330686: Fix typos in the DatabaseMetaData javadoc [v4]

2024-04-26 Thread Jin Kwon
On Sat, 27 Apr 2024 01:45:47 GMT, Jaikiran Pai wrote: >> Jin Kwon has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8330686: Fix typos in the DatabaseMetaData javadoc >> >> Reviewed-by: jpai, lancea, iris > > Yes, the PR has been merg

Re: RFR: 8330686: Fix typos in the DatabaseMetaData javadoc [v4]

2024-04-26 Thread Jaikiran Pai
On Sat, 27 Apr 2024 00:35:26 GMT, Jin Kwon wrote: >> Fix typos within the `DatabaseMetaData.java`. > > Jin Kwon has updated the pull request incrementally with one additional > commit since the last revision: > > 8330686: Fix typos in the DatabaseMetaData javadoc > > Reviewed-by: jpai, l

Re: RFR: 8330686: Fix typos in the DatabaseMetaData javadoc [v4]

2024-04-26 Thread Jin Kwon
On Sat, 27 Apr 2024 01:09:58 GMT, Jaikiran Pai wrote: >> Jin Kwon has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8330686: Fix typos in the DatabaseMetaData javadoc >> >> Reviewed-by: jpai, lancea, iris > > Hello Jin, once a PR is a

Integrated: 8330686: Fix typos in the DatabaseMetaData javadoc

2024-04-26 Thread Jin Kwon
On Fri, 19 Apr 2024 11:33:48 GMT, Jin Kwon wrote: > Fix typos within the `DatabaseMetaData.java`. This pull request has now been integrated. Changeset: aa2edd49 Author:Jin Kwon Committer: Jaikiran Pai URL: https://git.openjdk.org/jdk/commit/aa2edd491345cca1d8798848d71b151bc06c6c02

Re: RFR: 8330686: Fix typos in the DatabaseMetaData javadoc [v4]

2024-04-26 Thread Jaikiran Pai
On Sat, 27 Apr 2024 00:35:26 GMT, Jin Kwon wrote: >> Fix typos within the `DatabaseMetaData.java`. > > Jin Kwon has updated the pull request incrementally with one additional > commit since the last revision: > > 8330686: Fix typos in the DatabaseMetaData javadoc > > Reviewed-by: jpai, l

Re: RFR: 8330686: Fix typos in the DatabaseMetaData javadoc [v4]

2024-04-26 Thread Jin Kwon
> Fix typos within the `DatabaseMetaData.java`. Jin Kwon has updated the pull request incrementally with one additional commit since the last revision: 8330686: Fix typos in the DatabaseMetaData javadoc Reviewed-by: jpai, lancea, iris - Changes: - all: https://git.openjdk.

Re: RFR: 8320575: generic type information lost on mandated parameters of record's compact constructors [v17]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 23:54:17 GMT, Vicente Romero wrote: >> Reflection is not retrieving generic type information for mandated >> parameters. This is a known issue which has been explicitly stated in the >> API of some reflection methods. Fix for >> [JDK-8292275](https://bugs.openjdk.org/browse

Re: RFR: 8320575: generic type information lost on mandated parameters of record's compact constructors [v17]

2024-04-26 Thread Vicente Romero
> Reflection is not retrieving generic type information for mandated > parameters. This is a known issue which has been explicitly stated in the API > of some reflection methods. Fix for > [JDK-8292275](https://bugs.openjdk.org/browse/JDK-8292275) made the > parameters of compact constructors o

Re: RFR: 8320575: generic type information lost on mandated parameters of record's compact constructors [v15]

2024-04-26 Thread Vicente Romero
On Fri, 26 Apr 2024 21:27:55 GMT, Chen Liang wrote: >> Vicente Romero has updated the pull request incrementally with one >> additional commit since the last revision: >> >> special case the new code for records only > > src/java.base/share/classes/java/lang/reflect/Executable.java line 354:

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v5]

2024-04-26 Thread Mandy Chung
On Fri, 26 Apr 2024 22:27:43 GMT, Claes Redestad wrote: >> When analyzing (startup) performance of the Classfile API I found this >> opportunity to further improve `MethodTypeDescImpl::descriptorString`. >> >> Performance improves across the board in existing microbenchmarks: >> >> Name

Re: RFR: 8320575: generic type information lost on mandated parameters of record's compact constructors [v16]

2024-04-26 Thread Vicente Romero
> Reflection is not retrieving generic type information for mandated > parameters. This is a known issue which has been explicitly stated in the API > of some reflection methods. Fix for > [JDK-8292275](https://bugs.openjdk.org/browse/JDK-8292275) made the > parameters of compact constructors o

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v5]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 22:23:03 GMT, Claes Redestad wrote: >> When analyzing (startup) performance of the Classfile API I found this >> opportunity to further improve `MethodTypeDescImpl::descriptorString`. >> >> Performance improves across the board in existing microbenchmarks: >> >> Name

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v5]

2024-04-26 Thread Claes Redestad
> When analyzing (startup) performance of the Classfile API I found this > opportunity to further improve `MethodTypeDescImpl::descriptorString`. > > Performance improves across the board in existing microbenchmarks: > > Name > (de

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-04-26 Thread Chen Liang
On Tue, 23 Apr 2024 13:13:03 GMT, Per Minborg wrote: >> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 13 commits: >> >> - Use the improved form in forEach >> - Merge branch 'master' of https://github.com/openjdk/jdk

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v3]

2024-04-26 Thread Chen Liang
> Please review this patch that: > 1. Implemented `forEach` to optimize for 1 or 2 element collections. > 2. Implemented `spliterator` to optimize for a single element. > > The default implementations for multiple-element immutable collections are > fine as-is, specializing implementation doesn't

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 20:35:44 GMT, Mandy Chung wrote: >> While I agree it may seem non-sensical to define `CD_Object` for `Object`, >> there's precedent in that `Wrapper.primitiveType` is `Object.class` - so for >> consistency I wired it up the same way. For the usage patterns introduced >> wit

Re: RFR: 8320575: generic type information lost on mandated parameters of record's compact constructors [v15]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 21:15:20 GMT, Vicente Romero wrote: >> Reflection is not retrieving generic type information for mandated >> parameters. This is a known issue which has been explicitly stated in the >> API of some reflection methods. Fix for >> [JDK-8292275](https://bugs.openjdk.org/browse

Re: RFR: 8320575: generic type information lost on mandated parameters of record's compact constructors [v15]

2024-04-26 Thread Vicente Romero
> Reflection is not retrieving generic type information for mandated > parameters. This is a known issue which has been explicitly stated in the API > of some reflection methods. Fix for > [JDK-8292275](https://bugs.openjdk.org/browse/JDK-8292275) made the > parameters of compact constructors o

Re: RFR: 8320575: generic type information lost on mandated parameters of record's compact constructors [v14]

2024-04-26 Thread Vicente Romero
> Reflection is not retrieving generic type information for mandated > parameters. This is a known issue which has been explicitly stated in the API > of some reflection methods. Fix for > [JDK-8292275](https://bugs.openjdk.org/browse/JDK-8292275) made the > parameters of compact constructors o

Re: RFR: 7036144: GZIPInputStream readTrailer uses faulty available() test for end-of-stream [v9]

2024-04-26 Thread Lance Andersen
On Fri, 26 Apr 2024 20:33:33 GMT, Archie Cobbs wrote: > > Is there any chance of backporting this to java 17 or 21? What's involved > > in doing that? > > It's a straightforward process but I'm not sure I'm one to judge whether it > would be appropriate. > > @jaikiran and/or @LanceAndersen -

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v4]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 08:07:04 GMT, Claes Redestad wrote: >> When analyzing (startup) performance of the Classfile API I found this >> opportunity to further improve `MethodTypeDescImpl::descriptorString`. >> >> Performance improves across the board in existing microbenchmarks: >> >> Name

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Mandy Chung
On Fri, 26 Apr 2024 18:41:18 GMT, Claes Redestad wrote: >> src/java.base/share/classes/sun/invoke/util/Wrapper.java line 384: >> >>> 382: >>> 383: /** A nominal descriptor of the primitive type */ >>> 384: public ClassDesc primitiveClassDescriptor() { return >>> primitiveTypeDesc; } >>

Re: RFR: 7036144: GZIPInputStream readTrailer uses faulty available() test for end-of-stream [v9]

2024-04-26 Thread Archie Cobbs
On Fri, 26 Apr 2024 17:43:40 GMT, Louis Bergelson wrote: > Is there any chance of backporting this to java 17 or 21? What's involved in > doing that? It's a straightforward process but I'm not sure I'm one to judge whether it would be appropriate. @jaikiran and/or @LanceAndersen - any opnions

Re: RFR: 8331207: Misleading example in DateFormat#parse docs [v2]

2024-04-26 Thread Naoto Sato
On Fri, 26 Apr 2024 18:15:12 GMT, Justin Lu wrote: >> Correct a misleading example in the DateFormat parse documentation. >> >> Common usage is to use a factory instance. The original example provided >> assumes a pattern provided by a COMPAT factory instance. >> >> The pattern itself should

Integrated: 8303689: javac -Xlint could/should report on "dangling" doc comments

2024-04-26 Thread Jonathan Gibbons
On Wed, 27 Mar 2024 22:04:30 GMT, Jonathan Gibbons wrote: > Please review the updates to support a proposed new > `-Xlint:dangling-doc-comments` option. > > The work can be thought of as in 3 parts: > > 1. An update to the `javac` internal class `DeferredLintHandler` so that it > is possible

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v4]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 18:21:16 GMT, Mandy Chung wrote: > I am glad that this only focuses on the descriptor string as > `MethodTypeDesc::displayDescriptor` is typically used for debugging and > exception message and not performance-sensitive. Yes, which is why I'd really like to desugar it: this

Re: RFR: 8303689: javac -Xlint could/should report on "dangling" doc comments [v10]

2024-04-26 Thread Phil Race
On Fri, 26 Apr 2024 16:04:09 GMT, Jonathan Gibbons wrote: >> Please review the updates to support a proposed new >> `-Xlint:dangling-doc-comments` option. >> >> The work can be thought of as in 3 parts: >> >> 1. An update to the `javac` internal class `DeferredLintHandler` so that it >> is po

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v4]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 08:07:04 GMT, Claes Redestad wrote: >> When analyzing (startup) performance of the Classfile API I found this >> opportunity to further improve `MethodTypeDescImpl::descriptorString`. >> >> Performance improves across the board in existing microbenchmarks: >> >> Name

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 17:57:52 GMT, Mandy Chung wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Copyrights and other comments from @JornVernee > > src/java.base/share/classes/sun/invoke/util/Wrapper.java line 384:

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v4]

2024-04-26 Thread Mandy Chung
On Fri, 26 Apr 2024 08:07:04 GMT, Claes Redestad wrote: >> When analyzing (startup) performance of the Classfile API I found this >> opportunity to further improve `MethodTypeDescImpl::descriptorString`. >> >> Performance improves across the board in existing microbenchmarks: >> >> Name

Re: RFR: 8328821: Map.of().entrySet() mutators should throw UnsupportedOperationException

2024-04-26 Thread Liam Miller-Cushon
On Wed, 27 Mar 2024 17:36:28 GMT, Liam Miller-Cushon wrote: > This change overrides mutator methods in the implementation returned by > `Map.of().entrySet()` to throw `UnsupportedOperationException`. Please keep this open - PR Comment: https://git.openjdk.org/jdk/pull/18522#issuec

Re: RFR: 8331207: Misleading example in DateFormat#parse docs [v2]

2024-04-26 Thread Justin Lu
> Correct a misleading example in the DateFormat parse documentation. > > Common usage is to use a factory instance. The original example provided > assumes a pattern provided by a COMPAT factory instance. The pattern itself > should be explicitly provided. This is chosen over using a CLDR patt

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Mandy Chung
On Fri, 26 Apr 2024 11:51:51 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

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

2024-04-26 Thread Brent Christian
> 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. > > A couple key things we want to be able to say are: > - `Refer

RFR: 8331207: Misleading example in DateFormat#parse docs

2024-04-26 Thread Justin Lu
Correct a misleading example in the DateFormat parse documentation. Common usage is to use a factory instance. The original example provided assumes a pattern provided by a COMPAT factory instance, and does not work with a CLDR instance. The example should be updated to use a pattern provided

Re: RFR: 7036144: GZIPInputStream readTrailer uses faulty available() test for end-of-stream [v9]

2024-04-26 Thread Louis Bergelson
On Sun, 17 Mar 2024 22:53:55 GMT, Archie Cobbs wrote: >> `GZIPInputStream`, when looking for a concatenated stream, relies on what >> the underlying `InputStream` says is how many bytes are `available()`. But >> this is inappropriate because `InputStream.available()` is just an estimate >> and

Re: RFR: 8330684: ClassFile API runs into StackOverflowError while parsing certain class' bytes [v3]

2024-04-26 Thread Paul Sandoz
On Fri, 26 Apr 2024 13:34:08 GMT, Adam Sotona wrote: >> ClassFile API dives into the nested constant pool entries without type >> restrictions, while parsing a class file. Validation of the entry is >> performed post-parsing. Specifically corrupted constant pool entry may cause >> infinite loo

Re: RFR: 8303689: javac -Xlint could/should report on "dangling" doc comments [v10]

2024-04-26 Thread Jonathan Gibbons
> Please review the updates to support a proposed new > `-Xlint:dangling-doc-comments` option. > > The work can be thought of as in 3 parts: > > 1. An update to the `javac` internal class `DeferredLintHandler` so that it > is possible to specify the appropriately configured `Lint` object when i

Re: RFR: 8331134: Port SimpleStringBuilderStrategy to use ClassFile API [v10]

2024-04-26 Thread Mandy Chung
On Fri, 26 Apr 2024 14:57:07 GMT, Claes Redestad wrote: >> This patch suggests a workaround to an issue with huge SCF MH expression >> trees taking excessive JIT compilation resources by reviving (part of) the >> simple bytecode-generating strategy that was originally available as an >> all-or

Re: RFR: 8330005: RandomGeneratorFactory.getDefault() throws exception when the runtime image only has java.base module [v4]

2024-04-26 Thread Raffaello Giulietti
> Move all random generators mandated in package `java.util.random` and > currently implemented in module `jdk.random` to module `java.base`, and > remove module `jdk.random`. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: A

Re: RFR: 8330005: RandomGeneratorFactory.getDefault() throws exception when the runtime image only has java.base module [v3]

2024-04-26 Thread Raffaello Giulietti
On Fri, 26 Apr 2024 09:41:21 GMT, Raffaello Giulietti wrote: >> Move all random generators mandated in package `java.util.random` and >> currently implemented in module `jdk.random` to module `java.base`, and >> remove module `jdk.random`. > > Raffaello Giulietti has updated the pull request i

Re: In support of Instant.minus(Instant)

2024-04-26 Thread Roger Riggs
A constructive API enhancement. Created JDK-8331202 Support for duration between Instants Regards, Roger On 4/25/24 4:53 PM, Stephen Colebourne wrote: java.time.* already has the `until(ChronoLocalDate)` method on LocalDate. It would be reasonable

Re: RFR: 8331134: Port SimpleStringBuilderStrategy to use ClassFile API [v9]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 02:20:34 GMT, Mandy Chung wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Nits, clean up constant, introduce missing constant MethodTypeDesc for >> toString > > It's a little confusing for JD

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 14:47:16 GMT, Chen Liang wrote: > For the `equals` remark, it's that DynamicConstantDesc's equals is final so > subclasses cannot provide a faster implementation. But that's another topic. Hmm, that is unfortunate, yes. - PR Comment: https://git.openjdk.org/jdk

Re: RFR: 8331134: Port SimpleStringBuilderStrategy to use ClassFile API [v10]

2024-04-26 Thread Claes Redestad
> This patch suggests a workaround to an issue with huge SCF MH expression > trees taking excessive JIT compilation resources by reviving (part of) the > simple bytecode-generating strategy that was originally available as an > all-or-nothing strategy choice. > > Instead of reintroducing a bin

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 11:51:51 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

Re: RFR: 8325438: Add exhaustive tests for Math.round intrinsics [v12]

2024-04-26 Thread Hamlin Li
On Tue, 23 Apr 2024 09:46:08 GMT, Hamlin Li wrote: >> HI, >> Can you have a look at this patch adding some tests for Math.round >> instrinsics? >> Thanks! >> >> ### FYI: >> During the development of RoundVF/RoundF, we faced the issues which were >> only spotted by running test exhaustively aga

RFR: 8331196: vector api: Remove unnecessary index check in Byte/ShortVector.fromArray/fromArray0Template

2024-04-26 Thread Hamlin Li
Hi, Can you help to review this simple patch? Some index check in Byte/ShortVector.fromArray/fromArray0Template seems not necessary, could be removed. Thanks - Commit messages: - Initial commit Changes: https://git.openjdk.org/jdk/pull/18977/files Webrev: https://webrevs.openjdk.

Integrated: 8330624: Inconsistent use of semicolon in the code snippet of java.io.Serializable javadoc

2024-04-26 Thread Korov
On Sat, 20 Apr 2024 11:49:30 GMT, Korov wrote: > Fix the description of java.io.Serializable. This pull request has now been integrated. Changeset: 0bf516f7 Author:Korov Committer: Roger Riggs URL: https://git.openjdk.org/jdk/commit/0bf516f7ba8425134ca42d856648ab19f5c69a86 Stats:

Integrated: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 10:27:16 GMT, Claes Redestad wrote: > This PR makes ClassDesc.ofDescriptor return the shared constant for primitive > descriptor strings ("I" etc..), and leverages this further by refactoring > `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate substring for > prim

Re: RFR: 8330005: RandomGeneratorFactory.getDefault() throws exception when the runtime image only has java.base module [v3]

2024-04-26 Thread Alan Bateman
On Fri, 26 Apr 2024 09:41:21 GMT, Raffaello Giulietti wrote: >> Move all random generators mandated in package `java.util.random` and >> currently implemented in module `jdk.random` to module `java.base`, and >> remove module `jdk.random`. > > Raffaello Giulietti has updated the pull request i

Re: RFR: 8278255: add more warning text in ReentrantLock and ReentrantReadWriteLock

2024-04-26 Thread Pavel Rappo
On Fri, 26 Apr 2024 11:43:06 GMT, Viktor Klang wrote: > This is an attempt to be more clear about recommendations on Lock usage. src/java.base/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java line 162: > 160: * } > 161: * } > 162: * // Make sure that code w

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 12:43:32 GMT, Chen Liang wrote: > Primitive class desc sharing should be really helpful, especially considering > that they are represented as condy and their `equals` is thus quite > inefficient. Ok. We could consider overriding `equals` in `PrimitiveClassDescImpl` if this

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 12:58:35 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/constant/ClassDesc.java line 163: >> >>> 161: // implicit null-check >>> 162: return (descriptor.length() == 1) >>> 163:? >>> Wrapper.forPrimitiveType(descriptor.charAt(0

Re: RFR: 8296543: Update exception documentation for ExecutorService.invokeAll overriders as required

2024-04-26 Thread Alan Bateman
On Fri, 26 Apr 2024 08:08:25 GMT, Viktor Klang wrote: > This PR adds the exception documentation as per the ExecutorService API > contract. I also took the liberty of adding @Override-annotations to be clear > about intent. Marked as reviewed by alanb (Reviewer). I think this is okay. The thr

Re: RFR: 8330684: ClassFile API runs into StackOverflowError while parsing certain class' bytes [v3]

2024-04-26 Thread Adam Sotona
> ClassFile API dives into the nested constant pool entries without type > restrictions, while parsing a class file. Validation of the entry is > performed post-parsing. Specifically corrupted constant pool entry may cause > infinite loop during parsing and throws SOE. > This patch resolves the

Re: RFR: 8278255: add more warning text in ReentrantLock and ReentrantReadWriteLock

2024-04-26 Thread Doug Lea
On Fri, 26 Apr 2024 11:43:06 GMT, Viktor Klang wrote: > This is an attempt to be more clear about recommendations on Lock usage. Thanks for finally processing this after we let this good suggestion sit for too long! - PR Comment: https://git.openjdk.org/jdk/pull/18974#issuecomment

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 11:51:51 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 11:51:51 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Chen Liang
On Fri, 26 Apr 2024 11:51:51 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

Re: RFR: 8296543: Update exception documentation for ExecutorService.invokeAll overriders as required

2024-04-26 Thread Pavel Rappo
On Fri, 26 Apr 2024 08:08:25 GMT, Viktor Klang wrote: > This PR adds the exception documentation as per the ExecutorService API > contract. I also took the liberty of adding @Override-annotations to be clear > about intent. Both markup and generated documentation look good. - Mar

Integrated: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases

2024-04-26 Thread Claes Redestad
On Thu, 25 Apr 2024 14:15:56 GMT, Claes Redestad wrote: > Splitting out the ASM-based version from #18690 to push that first under the > JBS (to help backporting). Keeping #18690 open to rebase and follow-up on > this as a subtask. See discussion in that #18690 for more details, discussion > a

Re: RFR: 8296543: Update exception documentation for ExecutorService.invokeAll overriders as required

2024-04-26 Thread Pavel Rappo
On Fri, 26 Apr 2024 11:54:15 GMT, Doug Lea wrote: > This seems OK, but could someone read the generated javadoc to make sure > there are no surprises? Sometimes inheritDocs don't come out as expected. I'll make sure it's as expected. - PR Comment: https://git.openjdk.org/jdk/pull/

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Jorn Vernee
On Fri, 26 Apr 2024 11:51:51 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v2]

2024-04-26 Thread Jorn Vernee
On Fri, 26 Apr 2024 11:49:19 GMT, Claes Redestad wrote: > > Does removing the explicit null checks make that much difference for > > performance? They are kind of nice for clarity. > > It helps startup at least. The redundant array depth check mattered a bit for > peak performance, but not muc

Re: RFR: 8296543: Update exception documentation for ExecutorService.invokeAll overriders as required

2024-04-26 Thread Doug Lea
On Fri, 26 Apr 2024 08:08:25 GMT, Viktor Klang wrote: > This PR adds the exception documentation as per the ExecutorService API > contract. I also took the liberty of adding @Override-annotations to be clear > about intent. This seems OK, but could someone read the generated javadoc to make su

Re: RFR: 8330684: ClassFile API runs into StackOverflowError while parsing certain class' bytes [v2]

2024-04-26 Thread ExE Boss
On Fri, 26 Apr 2024 07:43:01 GMT, Adam Sotona wrote: >> ClassFile API dives into the nested constant pool entries without type >> restrictions, while parsing a class file. Validation of the entry is >> performed post-parsing. Specifically corrupted constant pool entry may cause >> infinite loo

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v2]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 11:27:35 GMT, Jorn Vernee wrote: > Looks like your `MethodTypeDescFactories` benchmark is missing form the PR? > Pre-existing. > Does removing the explicit null checks make that much difference for > performance? They are kind of nice for clarity. > It helps startup at le

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v3]

2024-04-26 Thread Claes Redestad
> This PR makes ClassDesc.ofDescriptor return the shared constant for primitive > descriptor strings ("I" etc..), and leverages this further by refactoring > `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate substring for > primitives. > > Microbenchmarks results look good with expec

Re: RFR: 8278255: add more warning text in ReentrantLock and ReentrantReadWriteLock

2024-04-26 Thread Viktor Klang
On Fri, 26 Apr 2024 11:43:06 GMT, Viktor Klang wrote: > This is an attempt to be more clear about recommendations on Lock usage. @stuart-marks Would this be better? 🤔 - PR Comment: https://git.openjdk.org/jdk/pull/18974#issuecomment-2079225009

RFR: 8278255: add more warning text in ReentrantLock and ReentrantReadWriteLock

2024-04-26 Thread Viktor Klang
This is an attempt to be more clear about recommendations on Lock usage. - Commit messages: - Adding more clarification to proper usage of locks Changes: https://git.openjdk.org/jdk/pull/18974/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18974&range=00 Issue: https://b

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v2]

2024-04-26 Thread Jorn Vernee
On Fri, 26 Apr 2024 10:54:49 GMT, Claes Redestad wrote: >> This PR makes ClassDesc.ofDescriptor return the shared constant for >> primitive descriptor strings ("I" etc..), and leverages this further by >> refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate >> substring for

Re: RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types [v2]

2024-04-26 Thread Claes Redestad
> This PR makes ClassDesc.ofDescriptor return the shared constant for primitive > descriptor strings ("I" etc..), and leverages this further by refactoring > `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate substring for > primitives. > > Microbenchmarks results look good with expec

RFR: 8331187: Optimize MethodTypeDesc and ClassDesc.ofDescriptor for primitive types

2024-04-26 Thread Claes Redestad
This PR makes ClassDesc.ofDescriptor return the shared constant for primitive descriptor strings ("I" etc..), and leverages this further by refactoring `MethodTypeDescImpl.ofDescriptor` to avoid the intermediate substring for primitives. Microbenchmarks results look good with expected speedups

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v4]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 09:42:06 GMT, Claes Redestad wrote: >> Splitting out the ASM-based version from #18690 to push that first under the >> JBS (to help backporting). Keeping #18690 open to rebase and follow-up on >> this as a subtask. See discussion in that #18690 for more details, >> discussi

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v3]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 08:45:45 GMT, Claes Redestad wrote: >> Splitting out the ASM-based version from #18690 to push that first under the >> JBS (to help backporting). Keeping #18690 open to rebase and follow-up on >> this as a subtask. See discussion in that #18690 for more details, >> discussi

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v4]

2024-04-26 Thread Claes Redestad
> Splitting out the ASM-based version from #18690 to push that first under the > JBS (to help backporting). Keeping #18690 open to rebase and follow-up on > this as a subtask. See discussion in that #18690 for more details, discussion > and motivation for this. Claes Redestad has updated the pu

Re: RFR: 8330005: RandomGeneratorFactory.getDefault() throws exception when the runtime image only has java.base module [v3]

2024-04-26 Thread Raffaello Giulietti
> Move all random generators mandated in package `java.util.random` and > currently implemented in module `jdk.random` to module `java.base`, and > remove module `jdk.random`. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: T

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v3]

2024-04-26 Thread Aleksey Shipilev
On Fri, 26 Apr 2024 08:45:45 GMT, Claes Redestad wrote: >> Splitting out the ASM-based version from #18690 to push that first under the >> JBS (to help backporting). Keeping #18690 open to rebase and follow-up on >> this as a subtask. See discussion in that #18690 for more details, >> discussi

Re: RFR: 8331108: Unused Math.abs call in java.lang.FdLibm.Expm1#compute [v2]

2024-04-26 Thread Raffaello Giulietti
On Fri, 26 Apr 2024 01:35:56 GMT, Joe Darcy wrote: >> Remove unnecessary setting of variable y, found by an IDE inspection noted >> in the bug report. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Update copyright year. Ma

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v2]

2024-04-26 Thread Claes Redestad
On Thu, 25 Apr 2024 19:53:46 GMT, Claes Redestad wrote: >> Splitting out the ASM-based version from #18690 to push that first under the >> JBS (to help backporting). Keeping #18690 open to rebase and follow-up on >> this as a subtask. See discussion in that #18690 for more details, >> discussi

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v3]

2024-04-26 Thread Claes Redestad
> Splitting out the ASM-based version from #18690 to push that first under the > JBS (to help backporting). Keeping #18690 open to rebase and follow-up on > this as a subtask. See discussion in that #18690 for more details, discussion > and motivation for this. Claes Redestad has updated the pu

Re: RFR: 8329862: libjli GetApplicationHome cleanups and enhance jli tracing [v5]

2024-04-26 Thread Alan Bateman
On Thu, 25 Apr 2024 13:17:51 GMT, Matthias Baesken wrote: > I removed the mentioned 'private JRE' check and also the related size check. Good, I'll look at it as soon as I can. I suspect we'll need some follow on issues as there are several issues here. - PR Comment: https://git.o

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v2]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 02:36:22 GMT, Chen Liang wrote: > Also a side note for backport: ClassFileDumper exists only since JDK 21, so > for earlier backports you need to use an alternative dumping method or remove > dumping ability. Yes, original code used ProxyClassDumper, which was renamed/rewor

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v2]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 03:14:54 GMT, Mandy Chung wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove accidental use of java.lang.classfile > > src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java

Re: RFR: 8331134: Port SimpleStringBuilderStrategy to use ClassFile API [v9]

2024-04-26 Thread Claes Redestad
On Fri, 26 Apr 2024 02:20:34 GMT, Mandy Chung wrote: > It's a little confusing for JDK-8327247 to have 2 PRs but it's okay. We can > add a note in JDK-8327247 to clarify. I assume you plan to use PR to convert > to use ClassFile API after you pull from JDK-8327247 once integrated? Yes, this PR

Re: RFR: 8329862: libjli GetApplicationHome cleanups and enhance jli tracing [v6]

2024-04-26 Thread Matthias Baesken
On Thu, 25 Apr 2024 13:22:01 GMT, Matthias Baesken wrote: >> We have already good JLI tracing capabilities. But GetApplicationHome and >> GetApplicationHomeFromDll lack some tracing and should be enhanced. > > Matthias Baesken has updated the pull request incrementally with one > additional com

Integrated: 8329862: libjli GetApplicationHome cleanups and enhance jli tracing

2024-04-26 Thread Matthias Baesken
On Tue, 9 Apr 2024 15:28:08 GMT, Matthias Baesken wrote: > We have already good JLI tracing capabilities. But GetApplicationHome and > GetApplicationHomeFromDll lack some tracing and should be enhanced. This pull request has now been integrated. Changeset: 377f2e53 Author:Matthias Baesken

RFR: 8296543: Update exception documentation for ExecutorService.invokeAll overriders as required

2024-04-26 Thread Viktor Klang
This PR adds the exception documentation as per the ExecutorService API contract. I also took the liberty of adding @Override-annotations to be clear about intent. - Commit messages: - 8296543 - adding javadoc for thrown exceptions from AbstractExecutorService methods Changes: ht

Re: RFR: 8296543: Update exception documentation for ExecutorService.invokeAll overriders as required

2024-04-26 Thread Viktor Klang
On Fri, 26 Apr 2024 08:08:25 GMT, Viktor Klang wrote: > This PR adds the exception documentation as per the ExecutorService API > contract. I also took the liberty of adding @Override-annotations to be clear > about intent. @pavelrappo @DougLea Looks good? - PR Comment: https://g

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v3]

2024-04-26 Thread Claes Redestad
On Thu, 25 Apr 2024 23:03:58 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/constant/MethodTypeDescImpl.java line >> 181: >> >>> 179: sb.append(argType.descriptorString()); >>> 180: } >>> 181: desc = >>> sb.append(')').append(returnType().descriptor

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v3]

2024-04-26 Thread Claes Redestad
On Thu, 25 Apr 2024 23:06:00 GMT, Chen Liang wrote: > For the precise-length approach, do you have the results? I guess if we can > avoid copying the stringbuilder array, we can make this even faster. Not sure what you mean - the latest performance numbers I posted are for the precise length v

Re: RFR: 8331114: Further improve performance of MethodTypeDesc::descriptorString [v4]

2024-04-26 Thread Claes Redestad
> When analyzing (startup) performance of the Classfile API I found this > opportunity to further improve `MethodTypeDescImpl::descriptorString`. > > Performance improves across the board in existing microbenchmarks: > > Name > (de

Re: RFR: 8329862: libjli GetApplicationHome cleanups and enhance jli tracing [v6]

2024-04-26 Thread Christoph Langer
On Thu, 25 Apr 2024 13:22:01 GMT, Matthias Baesken wrote: >> We have already good JLI tracing capabilities. But GetApplicationHome and >> GetApplicationHomeFromDll lack some tracing and should be enhanced. > > Matthias Baesken has updated the pull request incrementally with one > additional com

Re: RFR: 8330684: ClassFile API runs into StackOverflowError while parsing certain class' bytes [v2]

2024-04-26 Thread Adam Sotona
On Thu, 25 Apr 2024 20:16:09 GMT, Paul Sandoz wrote: > It could be two tags, a lower and upper bound, because TAG_FIELDREF, > TAG_METHODREF, and TAG_INTERFACEMETHODREF are consecutive values (9 to 11). OK, I've implemented it with lower and upper bound tags. Thanks! - PR Comment:

Re: RFR: 8329862: libjli GetApplicationHome cleanups and enhance jli tracing [v6]

2024-04-26 Thread Matthias Baesken
On Fri, 26 Apr 2024 07:00:07 GMT, Thomas Stuefe wrote: > Still looks good. We should maybe change the synopsis (title) of the bug to > something like "libjli GetApplicationHome cleanups"? I changed the synopsis because it was indeed now not really reflecting any more what the change does. ---

Re: RFR: 8330684: ClassFile API runs into StackOverflowError while parsing certain class' bytes [v2]

2024-04-26 Thread Adam Sotona
> ClassFile API dives into the nested constant pool entries without type > restrictions, while parsing a class file. Validation of the entry is > performed post-parsing. Specifically corrupted constant pool entry may cause > infinite loop during parsing and throws SOE. > This patch resolves the

Integrated: 8322847: java.lang.classfile.BufWriter should specify @throws for its writeXXX methods

2024-04-26 Thread Adam Sotona
On Tue, 23 Apr 2024 11:56:41 GMT, Adam Sotona wrote: > This patch adds missing `@throws` javadoc annotations to > `java.lang.classfile.BufWriter`. > > Please review. > > Thank you, > Adam This pull request has now been integrated. Changeset: ea061298 Author:Adam Sotona URL: https

Re: RFR: 8329862: GetApplicationHome and GetApplicationHomeFromDll enhance jli tracing [v6]

2024-04-26 Thread Thomas Stuefe
On Thu, 25 Apr 2024 13:22:01 GMT, Matthias Baesken wrote: >> We have already good JLI tracing capabilities. But GetApplicationHome and >> GetApplicationHomeFromDll lack some tracing and should be enhanced. > > Matthias Baesken has updated the pull request incrementally with one > additional com