Re: RFR: 8311122: Fix typos in java.base

2023-06-29 Thread Hamlin Li
On Thu, 29 Jun 2023 21:17:49 GMT, Pavel Rappo wrote: > Please review this IDE-assisted typo hunt, which I plan to backport to jdk21. Marked as reviewed by mli (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/14718#pullrequestreview-1506596503

Re: RFR: 8310929: Optimization for Integer.toString [v5]

2023-06-29 Thread 温绍锦
> Speed up Integer.toString with a precomputed cache array of length 1000, use > division by 1000, so that each iteration can calculate three digits. > > this optimization can also be used in StringBuilder#appent(int) and > Long#toString. > > # Benchmark Result > > > bash configure --with-j

Re: RFR: 8307149: MethodHandles.arrayConstructor can be cached

2023-06-29 Thread Chen Liang
On Thu, 4 May 2023 23:29:17 GMT, Chen Liang wrote: > This patch migrates `MethodHandles::arrayConstructor`, added in Java 9 as a > hotfix to the incorrect constructor found on arrays via Lookup, to share the > array access caching features. The result is that calling > `MethodHandles.arrayCons

Re: RFR: 8310929: Optimization for Integer.toString [v4]

2023-06-29 Thread 温绍锦
> Speed up Integer.toString with a precomputed cache array of length 1000, use > division by 1000, so that each iteration can calculate three digits. > > this optimization can also be used in StringBuilder#appent(int) and > Long#toString. > > # Benchmark Result > > > bash configure --with-j

Re: RFR: JDK-8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Jim Laskey
On Thu, 29 Jun 2023 20:14:10 GMT, Joe Darcy wrote: > Typo fix; running a spell check over the comments and strings in the file, > didn't notice any other problems. I'd like to blame it on a spellchecker but it's more likely two left thumbs. - PR Comment: https://git.openjdk.org/jd

Re: RFR: JDK-8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread David Holmes
On Thu, 29 Jun 2023 20:14:10 GMT, Joe Darcy wrote: > Typo fix; running a spell check over the comments and strings in the file, > didn't notice any other problems. And ironically no one noticed the typo in the JBS issue title. - PR Comment: https://git.openjdk.org/jdk/pull/14717#i

Re: RFR: 8311084: Add typeSymbol() API for applicable constant pool entries [v2]

2023-06-29 Thread Chen Liang
> 5 Constant Pool entries, namely ConstantDynamicEntry, InvokeDynamicEntry, > FieldRefEntry, MethodRefEntry, and InterfaceMethodRefEntry should have a > typeSymbol() API to return the nominal/symbolic descriptor (ClassDesc or > MethodTypeDesc). > > This API is not added to NameAndTypeEntry itse

Re: RFR: 8310929: Optimization for Integer.toString [v3]

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

Re: RFR: 8311084: Add typeSymbol() API for applicable constant pool entries

2023-06-29 Thread Chen Liang
On Thu, 29 Jun 2023 13:26:00 GMT, Brian Goetz wrote: >> src/java.base/share/classes/jdk/internal/classfile/constantpool/InvokeDynamicEntry.java >> line 46: >> >>> 44: default MethodTypeDesc typeSymbol() { >>> 45: return Util.methodTypeSymbol(nameAndType()); >>> 46: } >> >> Simi

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread David Holmes
On Thu, 29 Jun 2023 13:05:58 GMT, Leo Korinth wrote: > My changes look like this in the diff output > ``` > } > - > ``` Thanks for showing this and other output. To me this looked like the final newline had been removed. I would have expected to see something that more obviously showed more

Re: RFR: 8254566: Clarify the spec of ClassLoader::getClassLoadingLock for non-parallel capable loader [v2]

2023-06-29 Thread David Holmes
On Fri, 30 Jun 2023 00:22:13 GMT, Mandy Chung wrote: >> The spec of `ClassLoader::getClassLoadingLock` is unclear that this method >> is intended for parallel-capable class loader implementations to provide an >> alternate implementation. For non-parallel-capable class loaders, this >> metho

Re: RFR: 8310929: Optimization for Integer.toString [v3]

2023-06-29 Thread 温绍锦
> Speed up Integer.toString with a precomputed cache array of length 1000, use > division by 1000, so that each iteration can calculate three digits. > > this optimization can also be used in StringBuilder#appent(int) and > Long#toString. > > # Benchmark Result > > > bash configure --with-j

Re: RFR: 8311085: Remove implementation detail writeTo from LocalVariable(Type) [v3]

2023-06-29 Thread Chen Liang
> `LocalVariable` and `LocalVariableType` includes `writeTo(BufWriter)`, which > should be implementation details. > > See > https://mail.openjdk.org/pipermail/classfile-api-dev/2023-June/000381.html > for context. > > This patch moves the implementation to `DirectCodeBuilder`'s original use

Re: RFR: 8311085: Remove implementation detail writeTo from LocalVariable(Type) [v2]

2023-06-29 Thread Chen Liang
> `LocalVariable` and `LocalVariableType` includes `writeTo(BufWriter)`, which > should be implementation details. > > See > https://mail.openjdk.org/pipermail/classfile-api-dev/2023-June/000381.html > for context. > > This patch moves the implementation to `DirectCodeBuilder`'s original use

Re: RFR: 8254566: Clarify the spec of ClassLoader::getClassLoadingLock for non-parallel capable loader [v2]

2023-06-29 Thread Mandy Chung
On Fri, 30 Jun 2023 00:06:08 GMT, David Holmes wrote: >> Mandy Chung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> review comment > > src/java.base/share/classes/java/lang/ClassLoader.java line 658: > >> 656: * finer-grained lock

Re: RFR: 8254566: Clarify the spec of ClassLoader::getClassLoadingLock for non-parallel capable loader [v2]

2023-06-29 Thread Mandy Chung
> The spec of `ClassLoader::getClassLoadingLock` is unclear that this method is > intended for parallel-capable class loader implementations to provide an > alternate implementation. For non-parallel-capable class loaders, this > method should return this `ClassLoader` object. The javadoc us

Re: RFR: 8254566: Clarify the spec of ClassLoader::getClassLoadingLock for non-parallel capable loader

2023-06-29 Thread David Holmes
On Thu, 29 Jun 2023 23:39:55 GMT, Mandy Chung wrote: > The spec of `ClassLoader::getClassLoadingLock` is unclear that this method is > intended for parallel-capable class loader implementations to provide an > alternate implementation. For non-parallel-capable class loaders, this > method sh

RFR: 8254566: Clarify the spec of ClassLoader::getClassLoadingLock for non-parallel capable loader

2023-06-29 Thread Mandy Chung
8254566: Clarify the spec of ClassLoader::getClassLoadingLock for non-parallel capable loader - Commit messages: - 8254566: Clarify the spec of ClassLoader::loadClass about the lock acquired by non-parallel capable loader Changes: https://git.openjdk.org/jdk/pull/14720/files Webr

Re: RFR: 8310923: Refactor Currency tests to use JUnit [v4]

2023-06-29 Thread Naoto Sato
On Wed, 28 Jun 2023 20:49:18 GMT, Justin Lu wrote: >> Please review this PR which refactors Currency tests to use JUnit. >> >> The most significant change occurs in `ValidateISO4217.java`. Other changes >> to this file excluding the JUnit refactoring include >> >> - Tests are no longer depende

Re: RFR: 8301341: LinkedTransferQueue does not respect timeout for poll() [v3]

2023-06-29 Thread Doug Lea
> This now uses Thread.isVirtual to distinguish spin vs immediate block cases, > enabling re-introduction of spin control from the previous version, removing > anomalies like this one. Doug Lea has updated the pull request incrementally with one additional commit since the last revision: Ove

Re: RFR: 8311122: Fix typos in java.base

2023-06-29 Thread Pavel Rappo
On Thu, 29 Jun 2023 21:17:49 GMT, Pavel Rappo wrote: > Please review this IDE-assisted typo hunt, which I plan to backport to jdk21. Our CI tests are fine with this change. That said, I'll wait for security-dev to complete the review, and then wait for a few more days so that others could also

Re: RFR: 8240567: MethodTooLargeException thrown while creating a jlink image [v5]

2023-06-29 Thread Oliver Kopp
On Thu, 29 Jun 2023 17:37:02 GMT, Alan Bateman wrote: > The size of the generated moduleDescriptors is a function of the number of > modules, the number of packages in the modules, number of exports, ... I > think your approach is okay for now, meaning pick some threshold that you are > confid

Re: RFR: 8301341: LinkedTransferQueue does not respect timeout for poll() [v2]

2023-06-29 Thread Doug Lea
> This now uses Thread.isVirtual to distinguish spin vs immediate block cases, > enabling re-introduction of spin control from the previous version, removing > anomalies like this one. Doug Lea has updated the pull request with a new target base due to a merge or a rebase. The incremental webre

Re: RFR: 6960866: [Fmt-Ch] ChoiceFormat claims impossible and unimplemented functionality

2023-06-29 Thread Naoto Sato
On Thu, 29 Jun 2023 18:02:00 GMT, Justin Lu wrote: > Please review this PR, which clarifies the parameter description of > ChoiceFormat.setChoices(). > > `ChoiceFormat.setChoices(double[] limits, String[] formats)` claims that > `formats` can either be "Format objects or Strings". It also clai

Re: RFR: 8311122: Fix typos in java.base

2023-06-29 Thread Iris Clark
On Thu, 29 Jun 2023 21:17:49 GMT, Pavel Rappo wrote: > Please review this IDE-assisted typo hunt, which I plan to backport to jdk21. Marked as reviewed by iris (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/14718#pullrequestreview-1506190678

Re: RFR: 8311122: Fix typos in java.base

2023-06-29 Thread Mandy Chung
On Thu, 29 Jun 2023 21:17:49 GMT, Pavel Rappo wrote: > Please review this IDE-assisted typo hunt, which I plan to backport to jdk21. Marked as reviewed by mchung (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/14718#pullrequestreview-1506186255

Re: RFR: 8311122: Fix typos in java.base

2023-06-29 Thread Naoto Sato
On Thu, 29 Jun 2023 21:17:49 GMT, Pavel Rappo wrote: > Please review this IDE-assisted typo hunt, which I plan to backport to jdk21. LGTM - Marked as reviewed by naoto (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/14718#pullrequestreview-1506183994

Re: RFR: 8311122: Fix typos in java.base

2023-06-29 Thread Pavel Rappo
On Thu, 29 Jun 2023 21:28:39 GMT, Joe Darcy wrote: > Looks fine, but please give some time for others reviewers before pushing. Absolutely! Also, this PR contains a code change (a typo in an error message), which, technically speaking, disqualifies the bug from being "noreg-doc" and requires

Re: RFR: 8311122: Fix typos in java.base

2023-06-29 Thread Joe Darcy
On Thu, 29 Jun 2023 21:17:49 GMT, Pavel Rappo wrote: > Please review this IDE-assisted typo hunt, which I plan to backport to jdk21. Looks fine, but please give some time for others reviewers before pushing. - Marked as reviewed by darcy (Reviewer). PR Review: https://git.openjdk.

RFR: 8311122: Fix typos in java.base

2023-06-29 Thread Pavel Rappo
Please review this IDE-assisted typo hunt, which I plan to backport to jdk21. - Commit messages: - Fix copyright years - Initial commit Changes: https://git.openjdk.org/jdk/pull/14718/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14718&range=00 Issue: https://bugs.openj

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]

2023-06-29 Thread Jim Laskey
On Thu, 29 Jun 2023 20:54:31 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove warning tied to String Templates > > src/java.base/share/classes/jdk/internal/util/ReferencedKeySet.java line 65: >

Re: RFR: 8240567: MethodTooLargeException thrown while creating a jlink image [v6]

2023-06-29 Thread Mandy Chung
On Thu, 29 Jun 2023 19:15:15 GMT, Oliver Kopp wrote: >> Fix for [JDK-8240567](https://bugs.openjdk.org/browse/JDK-8240567): >> "MethodTooLargeException thrown while creating a jlink image". >> >> Java still has a 64kb limit: A method may not be longer than 64kb. The idea >> of the fix is to sp

Re: RFR: 8240567: MethodTooLargeException thrown while creating a jlink image [v6]

2023-06-29 Thread Mandy Chung
On Thu, 29 Jun 2023 20:34:58 GMT, Mandy Chung wrote: >> Oliver Kopp has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix threshold > > test/jdk/tools/jlink/JLink100Modules.java line 47: > >> 45: * jdk.compiler >> 46: * @build

Integrated: 8310241: OffsetDateTime compareTo redundant computation

2023-06-29 Thread Roger Riggs
On Thu, 22 Jun 2023 19:03:03 GMT, Roger Riggs wrote: > Remove a redundant comparison in java.time `OffsetDateTime.compareTo()`. > If the `compareInstant` utility method returns 0 (equal), it compares the > `LocalDateTime`. > However, `compareInstant` has already done that comparison; if it foun

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

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

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]

2023-06-29 Thread Roger Riggs
On Thu, 29 Jun 2023 18:24:33 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

[jdk21] Integrated: 8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Joe Darcy
On Thu, 29 Jun 2023 20:37:09 GMT, Joe Darcy wrote: > Make the docs in JDK 21 better too. This pull request has now been integrated. Changeset: 60db329e Author:Joe Darcy URL: https://git.openjdk.org/jdk21/commit/60db329e4cd2a9fe7f7f23e0ddde3356bab8ba51 Stats: 2 lines in 1 file ch

Re: [jdk21] RFR: 8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Pavel Rappo
On Thu, 29 Jun 2023 20:37:09 GMT, Joe Darcy wrote: > Make the docs in JDK 21 better too. Marked as reviewed by prappo (Reviewer). - PR Review: https://git.openjdk.org/jdk21/pull/82#pullrequestreview-1506105696

[jdk21] RFR: 8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Joe Darcy
Make the docs in JDK 21 better too. - Commit messages: - Backport d97966266e343671693825d2211a34fa45dd271d Changes: https://git.openjdk.org/jdk21/pull/82/files Webrev: https://webrevs.openjdk.org/?repo=jdk21&pr=82&range=00 Issue: https://bugs.openjdk.org/browse/JDK-835 Stat

Re: RFR: JDK-8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Mandy Chung
On Thu, 29 Jun 2023 20:14:10 GMT, Joe Darcy wrote: > Typo fix; running a spell check over the comments and strings in the file, > didn't notice any other problems. Marked as reviewed by mchung (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/14717#pullrequestreview-150607

Integrated: JDK-8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Joe Darcy
On Thu, 29 Jun 2023 20:14:10 GMT, Joe Darcy wrote: > Typo fix; running a spell check over the comments and strings in the file, > didn't notice any other problems. This pull request has now been integrated. Changeset: d9796626 Author:Joe Darcy URL: https://git.openjdk.org/jdk/commi

Re: RFR: JDK-8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Brian Burkhalter
On Thu, 29 Jun 2023 20:14:10 GMT, Joe Darcy wrote: > Typo fix; running a spell check over the comments and strings in the file, > didn't notice any other problems. Marked as reviewed by bpb (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/14717#pullrequestreview-150607156

Re: RFR: JDK-8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Jim Laskey
On Thu, 29 Jun 2023 20:14:10 GMT, Joe Darcy wrote: > Typo fix; running a spell check over the comments and strings in the file, > didn't notice any other problems. Marked as reviewed by jlaskey (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/14717#pullrequestreview-15060

RFR: JDK-8311115: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER

2023-06-29 Thread Joe Darcy
Typo fix; running a spell check over the comments and strings in the file, didn't notice any other problems. - Commit messages: - JDK-835: Type in java.lang.reflect.AccessFlag.METHOD_PARAMETER Changes: https://git.openjdk.org/jdk/pull/14717/files Webrev: https://webrevs.openjd

Re: RFR: JDK-8308398 Move SunEC crypto provider into java.base [v2]

2023-06-29 Thread Anthony Scarpino
On Thu, 29 Jun 2023 18:36:55 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> update for review: changed test, removed commented out code in module, >> fixed switch statement, added --limit-m

Re: RFR: 8309622: Re-examine the cache mechanism in BaseLocale [v4]

2023-06-29 Thread Naoto Sato
> This is stemming from the PR: https://github.com/openjdk/jdk/pull/14211 where > aggressive GC can cause NPE in `BaseLocale$Key` class. I refactored the > in-house cache with WeakHashMap, and removed the Key class as it is no longer > needed (thus the original NPE will no longer be possible). A

Re: RFR: 8240567: MethodTooLargeException thrown while creating a jlink image [v6]

2023-06-29 Thread Oliver Kopp
> Fix for [JDK-8240567](https://bugs.openjdk.org/browse/JDK-8240567): > "MethodTooLargeException thrown while creating a jlink image". > > Java still has a 64kb limit: A method may not be longer than 64kb. The idea > of the fix is to split up the generated methods in several smaller methods > >

Re: RFR: JDK-8308398 Move SunEC crypto provider into java.base [v2]

2023-06-29 Thread Valerie Peng
On Mon, 26 Jun 2023 22:52:18 GMT, Anthony Scarpino wrote: >> Hi, >> >> I need a code review for moving the contents of the jdk.crypto.ec module >> into java.base. This moves the SunEC JCE Provider (Elliptic Curve) into >> java.base. EC has always been separate from the base module/pkg becau

Re: List extending Collection/SequencedCollection

2023-06-29 Thread Ryan Ernst
Thanks for replying, Joe. First, let me reiterate, we fully admit there was a bug in painless, we stopped short in walking the class hierarchy. There is no bug in the SequencedCollection hierarchy. But I do think there is an inconsistency. > The two definition are semantically equivalent > ... > T

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]

2023-06-29 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

RFR: 6960866: [Fmt-Ch] ChoiceFormat claims impossible and unimplemented functionality

2023-06-29 Thread Justin Lu
Please review this PR, which clarifies the parameter description of ChoiceFormat.setChoices(). `ChoiceFormat.setChoices(double[] limits, String[] formats)` claims that `formats` can either be "Format objects or Strings". It also claims that "When formatting with object Y, if the object is a Num

Re: RFR: 8240567: MethodTooLargeException thrown while creating a jlink image [v5]

2023-06-29 Thread Alan Bateman
On Fri, 23 Jun 2023 12:10:33 GMT, Oliver Kopp wrote: >> Fix for [JDK-8240567](https://bugs.openjdk.org/browse/JDK-8240567): >> "MethodTooLargeException thrown while creating a jlink image". >> >> Java still has a 64kb limit: A method may not be longer than 64kb. The idea >> of the fix is to sp

Re: RFR: 8310929: Optimization for Integer.toString [v2]

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

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared

2023-06-29 Thread Jim Laskey
On Thu, 29 Jun 2023 16:58:13 GMT, Naoto Sato wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared

2023-06-29 Thread Naoto Sato
On Tue, 27 Jun 2023 19:07:12 GMT, Jim Laskey wrote: > java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of th

Withdrawn: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread Leo Korinth
On Wed, 28 Jun 2023 16:54:51 GMT, Leo Korinth wrote: > Remove trailing "blank" lines in source files. > > I like to use global-whitespace-cleanup-mode, but I can not use it if the > files are "dirty" to begin with. This fix will make more files "clean". I > also considered adding a check for t

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread Leo Korinth
On Wed, 28 Jun 2023 16:54:51 GMT, Leo Korinth wrote: > Remove trailing "blank" lines in source files. > > I like to use global-whitespace-cleanup-mode, but I can not use it if the > files are "dirty" to begin with. This fix will make more files "clean". I > also considered adding a check for t

Re: RFR: 8294969: Convert jdk.jdeps javap to use the Classfile API [v6]

2023-06-29 Thread Adam Sotona
> javap uses proprietary com.sun.tools.classfile library to parse class files. > > This patch converts javap to use Classfile API. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 222

Integrated: 8310232: java.time.Clock$TickClock.millis() fails in runtime when tick is 1 microsecond

2023-06-29 Thread Naoto Sato
On Mon, 26 Jun 2023 17:31:29 GMT, Naoto Sato wrote: > Fixing the `/ by zero` exception with tick durations less than a millisecond. This pull request has now been integrated. Changeset: a995aa6c Author:Naoto Sato URL: https://git.openjdk.org/jdk/commit/a995aa6cd1cd89c2ca6db72b060177

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

2023-06-29 Thread Naoto Sato
On Wed, 28 Jun 2023 11:05:11 GMT, Sergey Tsypanov wrote: > Double-checked locking should rely on local variable to avoid racy reads from > volatile field. Retrieving the approval, per the discussion. - Changes requested by naoto (Reviewer). PR Review: https://git.openjdk.org/jdk/

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

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

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread Coleen Phillimore
On Wed, 28 Jun 2023 16:54:51 GMT, Leo Korinth wrote: > Remove trailing "blank" lines in source files. > > I like to use global-whitespace-cleanup-mode, but I can not use it if the > files are "dirty" to begin with. This fix will make more files "clean". I > also considered adding a check for t

RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared

2023-06-29 Thread Jim Laskey
java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent caching scheme for Carrier objects. The technique used is generally useful for a variety of caching schemes and is being moved to be shared in other parts of the jdk. The MethodType interning case is one example.

Re: RFR: 8310929: Optimization for Integer.toString [v2]

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

Re: RFR: 8310929: Optimization for Integer.toString [v2]

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

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

2023-06-29 Thread Aleksey Shipilev
On Wed, 28 Jun 2023 11:05:11 GMT, Sergey Tsypanov wrote: > Double-checked locking should rely on local variable to avoid racy reads from > volatile field. Yeah, current code looks like a correct volatile-bearing-DCL. `keySet` is safely published already. Introducing local variable gains us not

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread Leo Korinth
On Thu, 29 Jun 2023 12:40:34 GMT, Coleen Phillimore wrote: > You could fix your emacs functions. It is a *very nice* feature of global-whitespace-cleanup-mode - PR Comment: https://git.openjdk.org/jdk/pull/14698#issuecomment-1613252347

Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v34]

2023-06-29 Thread Jie Fu
On Thu, 29 Jun 2023 13:45:20 GMT, Alan Bateman wrote: > @DamonFool In the future, please wait at least 24 hours before sponsoring > changes like this. There have been 33 revisions of this change, many of the > people that have commented, potential reviewers are in many time zones and > need to

Re: RFR: 8311085: Remove implementation detail writeTo from LocalVariable(Type)

2023-06-29 Thread Brian Goetz
It is irritating that one is a type descriptor and one is a signature, but we can launder that by observing that both are Utf8Entry. On 6/29/2023 9:53 AM, Chen Liang wrote: On Thu, 29 Jun 2023 13:41:17 GMT, Brian Goetz wrote: `LocalVariable` and `LocalVariableType` includes `writeTo(BufWrite

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

2023-06-29 Thread Roger Riggs
On Wed, 28 Jun 2023 11:05:11 GMT, Sergey Tsypanov wrote: > Double-checked locking should rely on local variable to avoid racy reads from > volatile field. Given all the comments, I don't think this is ready to integrate. - Changes requested by rriggs (Reviewer). PR Review: https:

Re: RFR: 8311085: Remove implementation detail writeTo from LocalVariable(Type)

2023-06-29 Thread Chen Liang
On Thu, 29 Jun 2023 13:41:17 GMT, Brian Goetz wrote: >> `LocalVariable` and `LocalVariableType` includes `writeTo(BufWriter)`, which >> should be implementation details. >> >> See >> https://mail.openjdk.org/pipermail/classfile-api-dev/2023-June/000381.html >> for context. >> >> This patch m

Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v34]

2023-06-29 Thread Roger Riggs
On Thu, 29 Jun 2023 13:26:18 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v34]

2023-06-29 Thread Alan Bateman
On Thu, 29 Jun 2023 13:26:18 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

Re: RFR: 8311085: Remove implementation detail writeTo from LocalVariable(Type)

2023-06-29 Thread Brian Goetz
On Thu, 29 Jun 2023 09:59:08 GMT, Chen Liang wrote: > `LocalVariable` and `LocalVariableType` includes `writeTo(BufWriter)`, which > should be implementation details. > > See > https://mail.openjdk.org/pipermail/classfile-api-dev/2023-June/000381.html > for context. > > This patch moves the

Integrated: JDK-8310502 : Optimization for j.l.Long.fastUUID()

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

Re: RFR: 8311084: Add typeSymbol() API for applicable constant pool entries

2023-06-29 Thread Brian Goetz
On Thu, 29 Jun 2023 09:59:30 GMT, Chen Liang wrote: > 5 Constant Pool entries, namely ConstantDynamicEntry, InvokeDynamicEntry, > FieldRefEntry, MethodRefEntry, and InterfaceMethodRefEntry should have a > typeSymbol() API to return the nominal/symbolic descriptor (ClassDesc or > MethodTypeDesc

Re: RFR: 8311084: Add typeSymbol() API for applicable constant pool entries

2023-06-29 Thread Brian Goetz
On Thu, 29 Jun 2023 13:23:51 GMT, Brian Goetz wrote: >> 5 Constant Pool entries, namely ConstantDynamicEntry, InvokeDynamicEntry, >> FieldRefEntry, MethodRefEntry, and InterfaceMethodRefEntry should have a >> typeSymbol() API to return the nominal/symbolic descriptor (ClassDesc or >> MethodTyp

Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v34]

2023-06-29 Thread 温绍锦
> By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt Score Error Units > UUIDUtilsBenchmark.new

Re: java.util.stream.Stream: API for user-extensible intermediate operations

2023-06-29 Thread Viktor Klang
Over the past 6+ months I've been thinking about, and tinkering with, how we'd be able to expose a user-facing API for extensible intermediate java.util.stream.Stream operations―a feature envisioned all the way back when Streams were created. I'm now at a point where I have a viable design an

Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v33]

2023-06-29 Thread Jie Fu
On Thu, 29 Jun 2023 13:13:33 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

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

2023-06-29 Thread Daniel Fuchs
On Wed, 28 Jun 2023 11:05:11 GMT, Sergey Tsypanov wrote: > Double-checked locking should rely on local variable to avoid racy reads from > volatile field. The new code makes it more visible that 1. keySet is expected to be volatile and 2. that there is no path were code could be reordered lead

RFR: 8311084: Add typeSymbol() API for applicable constant pool entries

2023-06-29 Thread Chen Liang
5 Constant Pool entries, namely ConstantDynamicEntry, InvokeDynamicEntry, FieldRefEntry, MethodRefEntry, and InterfaceMethodRefEntry should have a typeSymbol() API to return the nominal/symbolic descriptor (ClassDesc or MethodTypeDesc). This API is not added to NameAndTypeEntry itself, for a Na

RFR: 8311085: Remove implementation detail writeTo from LocalVariable(Type)

2023-06-29 Thread Chen Liang
`LocalVariable` and `LocalVariableType` includes `writeTo(BufWriter)`, which should be implementation details. See https://mail.openjdk.org/pipermail/classfile-api-dev/2023-June/000381.html for context. This patch moves the implementation to `DirectCodeBuilder`'s original use sites; the old `b

Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v33]

2023-06-29 Thread 温绍锦
> By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt Score Error Units > UUIDUtilsBenchmark.new

Re: java.util.stream.Stream: API for user-extensible intermediate operations

2023-06-29 Thread Brian Goetz
Please be mindful of the request Viktor made: for feedback on the approach and the API concepts.  It should be pretty clear that low-level details like "unsupportedCombiner" are many levels down below "approach and concepts".  (And, you know the rule: when you bikeshed on a low-level detail whe

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread Leo Korinth
On Thu, 29 Jun 2023 12:11:40 GMT, David Holmes wrote: > Neither the PR diffs nor the webrev make it easy to see exactly what is being > changed here. It appeared to me that the last empty line of each file was > being deleted, leaving no newline at the end. My changes look like this in the dif

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread Coleen Phillimore
On Wed, 28 Jun 2023 16:54:51 GMT, Leo Korinth wrote: > Remove trailing "blank" lines in source files. > > I like to use global-whitespace-cleanup-mode, but I can not use it if the > files are "dirty" to begin with. This fix will make more files "clean". I > also considered adding a check for t

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread Leo Korinth
On Thu, 29 Jun 2023 12:01:03 GMT, Coleen Phillimore wrote: > Why do we care about this? I care because of global-whitespace-cleanup-mode (in emacs). It helps me remove trailing whitespaces and blanklines when saving but it will not fix a file that was "dirty" when it was opened. Trailing blank

Integrated: 8310848: Convert ClassDesc and MethodTypeDesc to be stored in static final fields

2023-06-29 Thread Chen Liang
On Sun, 25 Jun 2023 02:57:04 GMT, Chen Liang wrote: > This would encourage Classfile API users to use the descriptors as constants, > which can improve performance by avoiding repeated validation and reusing > cached descriptor strings for MethodTypeDesc. This patch updates usages in > the mai

Re: RFR: JDK-8308047 java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java timed out and also had jcmd pipe errors [v2]

2023-06-29 Thread Viktor Klang
On Fri, 9 Jun 2023 16:53:05 GMT, Alan Bateman wrote: >> Viktor Klang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Decresing the number of iterations proportional to the increase in the max >> memory size > > This looks okay to me and

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

2023-06-29 Thread Viktor Klang
On Thu, 29 Jun 2023 10:08:27 GMT, Sergey Tsypanov wrote: >> Looks ok; was this a tool detected race? > > @RogerRiggs no tool, just fell into the sources while debugging my application @stsypanov I don't see that there's any issue with the existing code as the volatile field is only written at m

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

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

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

2023-06-29 Thread David Holmes
On Wed, 28 Jun 2023 11:05:11 GMT, Sergey Tsypanov wrote: > Double-checked locking should rely on local variable to avoid racy reads from > volatile field. I don't see any race here. The addition of the local serves no purpose AFAICS - we don't even save any volatile reads. - PR C

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread David Holmes
On Wed, 28 Jun 2023 16:54:51 GMT, Leo Korinth wrote: > Remove trailing "blank" lines in source files. > > I like to use global-whitespace-cleanup-mode, but I can not use it if the > files are "dirty" to begin with. This fix will make more files "clean". I > also considered adding a check for t

Re: java.util.stream.Stream: API for user-extensible intermediate operations

2023-06-29 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Cc: "core-libs-dev" > Sent: Thursday, June 29, 2023 11:09:22 AM > Subject: Re: java.util.stream.Stream: API for user-extensible intermediate > operations > From: Remi Forax > Sent: Thursday, 29 June 2023 10:03 > To: Viktor Klang > Cc: core-libs-dev

Re: RFR: 8311043: Remove trailing blank lines in source files

2023-06-29 Thread Coleen Phillimore
On Wed, 28 Jun 2023 16:54:51 GMT, Leo Korinth wrote: > Remove trailing "blank" lines in source files. > > I like to use global-whitespace-cleanup-mode, but I can not use it if the > files are "dirty" to begin with. This fix will make more files "clean". I > also considered adding a check for t

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

2023-06-29 Thread Sergey Tsypanov
On Wed, 28 Jun 2023 20:02:58 GMT, Roger Riggs wrote: >> Double-checked locking should rely on local variable to avoid racy reads >> from volatile field. > > Looks ok; was this a tool detected race? @RogerRiggs no tool, just fell into the sources while debugging my application - PR

Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v32]

2023-06-29 Thread Chen Liang
On Thu, 29 Jun 2023 08:51:58 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

Integrated: 8308286 Fix clang warnings in linux code

2023-06-29 Thread Artem Semenov
On Wed, 17 May 2023 12:28:47 GMT, Artem Semenov wrote: > When using the clang compiler to build OpenJDk on Linux, we encounter various > "warnings as errors". > They can be fixed with small changes. This pull request has now been integrated. Changeset: 98a954ee Author:Artem Semenov URL:

Re: java.util.stream.Stream: API for user-extensible intermediate operations

2023-06-29 Thread Viktor Klang
From: Remi Forax Sent: Thursday, 29 June 2023 10:03 To: Viktor Klang Cc: core-libs-dev Subject: [External] : Re: java.util.stream.Stream: API for user-extensible intermediate operations From: "Viktor Klang" To: "core-libs-d

  1   2   >