Re: RFR: 8336927: Missing equals and hashCode in java.lang.classfile.Annotation [v2]

2024-07-23 Thread Adam Sotona
On Tue, 23 Jul 2024 15:43:42 GMT, Chen Liang wrote: >> Convert `AnnotationImpl` to a record so it comes with proper `equals` and >> `hashCode` implementations. This also fixes the comparison for >> annotation-valued annotation element values. > > Chen Liang has updated the pull request with a n

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode} [v3]

2024-07-23 Thread Joe Darcy
On Thu, 11 Jul 2024 00:11:07 GMT, Stuart Marks wrote: >> Joe Darcy has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Respond to review feedback. > > src/java.base/share/classes/java/lang/Object.java line 191: > >> 189: * should not b

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode} [v3]

2024-07-23 Thread Joe Darcy
On Mon, 15 Jul 2024 18:46:09 GMT, Kevin Bourrillion wrote: > I would hope to spend as little space on this as possible, perhaps "This > method should avoid throwing or propagating any exceptions unless it > legitimately _cannot_ adhere to this contract." (or shorter) Pushed a version using tha

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode} [v3]

2024-07-23 Thread Joe Darcy
> First pass at adding some quality of implementation discussions around the > overridable methods of Object. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Respond to review feedback. - Changes: - all: https://git.open

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode} [v2]

2024-07-23 Thread Joe Darcy
> First pass at adding some quality of implementation discussions around the > overridable methods of Object. Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull

Re: RFR: 8336856: Optimize String Concat [v9]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: want to try out small idea; where is the implementing class for Stream interface?

2024-07-23 Thread Chen Liang
Hi Anil, Ant is not a command-line tool of linux; it's an ancient Java build tool popular 10 years ago, before the appearance of Gradle. Its homepage is at https://ant.apache.org/ Once you download, extract it, and add its bin directory to PATH, the script will find ant automatically. Chen On Tue,

Re: want to try out small idea; where is the implementing class for Stream interface?

2024-07-23 Thread Anil
Chen, Thank you for your reply. I am unable to find ant in cygwin64 anilr@ANIL-LAPTOP /cygdrive/c/users/anil/OpenJDK/jdk $ bin/idea.sh FATAL: cannot find ant. Try setting ANT_HOME. When I run setup, I don't see it at all. [image: image.png] On Sun, Jul 21, 2024 at 6:46 PM Chen Liang wrote:

Re: RFR: 8336856: Optimize String Concat [v8]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v15]

2024-07-23 Thread Shaojin Wen
On Tue, 23 Jul 2024 13:48:57 GMT, Chen Liang wrote: >> explicit array stores has the overhead of boundary checking. If putCharsAt >> of StringLatin1 is not implemented based on Unsafe, the performance will be >> worse than StringUTF16. >> >> Of course, this is a common problem. StringUTF16.pu

Re: RFR: 8336679: Add @implSpec for the default implementations in Process.waitFor() [v3]

2024-07-23 Thread Naoto Sato
> This is a simple doc-only change that follows up > [JDK-8336479](https://bugs.openjdk.org/browse/JDK-8336479). A corresponding > CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: apiNote -> implNote ---

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v2]

2024-07-23 Thread Justin Lu
> As discussed in > https://github.com/openjdk/jdk/pull/19513#discussion_r1684957942, there is > code within java.text.NumberFormat (and subclasses) that can use the pattern > match switch to improve readability. > > As this is simply cleanup, there is no regression test added. (Tiers 1-3 and

Re: RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v5]

2024-07-23 Thread Kevin Driver
> Introduce an API for Key Derivation Functions (KDFs), which are cryptographic > algorithms for deriving additional keys from a secret key and other data. See > [JEP 478](https://openjdk.org/jeps/478). > > Work was begun in [another PR](https://github.com/openjdk/jdk/pull/18924). Kevin Driver

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v9]

2024-07-23 Thread Coleen Phillimore
On Tue, 23 Jul 2024 13:12:23 GMT, Coleen Phillimore wrote: >> src/hotspot/share/runtime/deoptimization.cpp line 1641: >> >>> 1639: assert(fr.is_deoptimized_frame(), "frame must be >>> scheduled for deoptimization"); >>> 1640: if (LockingMode == LM_LEGACY) { >>> 1641:

Integrated: 8336831: Optimize StringConcatHelper.simpleConcat

2024-07-23 Thread Shaojin Wen
On Fri, 19 Jul 2024 13:10:43 GMT, Shaojin Wen wrote: > Currently simpleConcat is implemented using mix and prepend, but in this > simple scenario, it can be implemented in a simpler way and can improve > performance. This pull request has now been integrated. Changeset: 476d2ae6 Author:Sh

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v7]

2024-07-23 Thread duke
On Tue, 23 Jul 2024 12:56:07 GMT, Shaojin Wen wrote: >> Currently simpleConcat is implemented using mix and prepend, but in this >> simple scenario, it can be implemented in a simpler way and can improve >> performance. > > Shaojin Wen has updated the pull request incrementally with one additio

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Abdelhak Zaaim
On Tue, 23 Jul 2024 17:28:02 GMT, Justin Lu wrote: > As discussed in > https://github.com/openjdk/jdk/pull/19513#discussion_r1684957942, there is > code within java.text.NumberFormat (and subclasses) that can use the pattern > match switch to improve readability. > > As this is simply cleanup

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v7]

2024-07-23 Thread Roger Riggs
On Tue, 23 Jul 2024 12:56:07 GMT, Shaojin Wen wrote: >> Currently simpleConcat is implemented using mix and prepend, but in this >> simple scenario, it can be implemented in a simpler way and can improve >> performance. > > Shaojin Wen has updated the pull request incrementally with one additio

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

2024-07-23 Thread Vladimir Ivanov
On Mon, 22 Jul 2024 17:19:46 GMT, Andrew Haley wrote: >> This patch expands the use of a hash table for secondary superclasses >> to the interpreter, C1, and runtime. It also adds a C2 implementation >> of hashed lookup in cases where the superclass isn't known at compile >> time. >> >> HotSpot

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

2024-07-23 Thread Vladimir Ivanov
On Mon, 22 Jul 2024 16:36:25 GMT, Andrew Haley wrote: >>> Alternatively, `Klass::is_subtype_of()` can unconditionally perform linear >>> search over secondary_supers array. >>> >>> Even though I very much like to see table lookup written in C++ >>> (accompanying heavily optimized platform-spec

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

2024-07-23 Thread Vladimir Ivanov
On Mon, 22 Jul 2024 17:19:46 GMT, Andrew Haley wrote: >> This patch expands the use of a hash table for secondary superclasses >> to the interpreter, C1, and runtime. It also adds a C2 implementation >> of hashed lookup in cases where the superclass isn't known at compile >> time. >> >> HotSpot

Re: RFR: 8336754: Remodel TypeAnnotation to "has" instead of "be" an Annotation [v5]

2024-07-23 Thread Chen Liang
> `TypeAnnotation` is not an annotation, as it should not be used in places > like `AnnotationValue.ofAnnotation`. Thus it's remodeled to contain an > annotation at a given location instead of to be an annotation. > > Depends on #20205. Chen Liang has updated the pull request incrementally with

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

2024-07-23 Thread Vladimir Ivanov
On Mon, 22 Jul 2024 16:45:06 GMT, Andrew Haley wrote: >> src/hotspot/cpu/x86/macroAssembler_x86.cpp line 4810: >> >>> 4808: Label* >>> L_success, >>> 4809: Label* >>> L_failure) {

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v9]

2024-07-23 Thread Coleen Phillimore
On Thu, 18 Jul 2024 11:30:27 GMT, Roman Kennke wrote: >> Axel Boldt-Christmas has updated the pull request incrementally with 10 >> additional commits since the last revision: >> >> - Remove try_read >> - Add explicit to single parameter constructors >> - Remove superfluous access specifier

Re: RFR: 8336754: Remodel TypeAnnotation to "has" instead of "be" an Annotation [v4]

2024-07-23 Thread Chen Liang
> `TypeAnnotation` is not an annotation, as it should not be used in places > like `AnnotationValue.ofAnnotation`. Thus it's remodeled to contain an > annotation at a given location instead of to be an annotation. > > Depends on #20205. Chen Liang has updated the pull request incrementally with

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v9]

2024-07-23 Thread Coleen Phillimore
On Wed, 17 Jul 2024 06:40:31 GMT, David Holmes wrote: >> src/hotspot/share/runtime/basicLock.hpp line 46: >> >>> 44: // Used as a cache the ObjectMonitor* used when locking. Must either >>> 45: // be nullptr or the ObjectMonitor* used when locking. >>> 46: volatile uintptr_t _metadata; >>

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v9]

2024-07-23 Thread Coleen Phillimore
On Wed, 17 Jul 2024 06:35:34 GMT, David Holmes wrote: >> Axel Boldt-Christmas has updated the pull request incrementally with 10 >> additional commits since the last revision: >> >> - Remove try_read >> - Add explicit to single parameter constructors >> - Remove superfluous access specifier

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v6]

2024-07-23 Thread Coleen Phillimore
On Mon, 15 Jul 2024 00:44:31 GMT, Axel Boldt-Christmas wrote: >> src/hotspot/share/runtime/basicLock.cpp line 37: >> >>> 35: if (mon != nullptr) { >>> 36: mon->print_on(st); >>> 37: } >> >> I am not sure if we wanted to do this, but we know the owner, therefore we >> could also

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v6]

2024-07-23 Thread Coleen Phillimore
On Tue, 23 Jul 2024 12:34:45 GMT, Coleen Phillimore wrote: >> I was thinking it was referring to `ObjectSynchronizer::waitUninterruptibly` >> added the same commit as the comment b3bf31a0a08da679ec2fd21613243fb17b1135a9 > > git backout restored the old wrong comment. We should fix this separate

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v9]

2024-07-23 Thread Coleen Phillimore
On Mon, 15 Jul 2024 00:50:30 GMT, Axel Boldt-Christmas wrote: >> When inflating a monitor the `ObjectMonitor*` is written directly over the >> `markWord` and any overwritten data is displaced into a displaced >> `markWord`. This is problematic for concurrent GCs which needs extra care or >> l

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

2024-07-23 Thread Vladimir Ivanov
On Mon, 22 Jul 2024 14:00:35 GMT, Andrew Haley wrote: >> Also, `num_extra_slots == 0` check is redundant. > >> Since `secondary_supers` are hashed unconditionally now, is >> `interfaces->length() <= 1` check still needed? > > I don't think so, no. Our incoming `transitive_interfaces` is formed

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

2024-07-23 Thread Vladimir Ivanov
On Mon, 22 Jul 2024 14:16:05 GMT, Andrew Haley wrote: >> src/hotspot/share/oops/klass.cpp line 175: >> >>> 173: if (secondary_supers()->at(i) == k) { >>> 174: if (UseSecondarySupersCache) { >>> 175: ((Klass*)this)->set_secondary_super_cache(k); >> >> Does it make sense to asse

Re: RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v4]

2024-07-23 Thread Kevin Driver
> Introduce an API for Key Derivation Functions (KDFs), which are cryptographic > algorithms for deriving additional keys from a secret key and other data. See > [JEP 478](https://openjdk.org/jeps/478). > > Work was begun in [another PR](https://github.com/openjdk/jdk/pull/18924). Kevin Driver

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

2024-07-23 Thread Vladimir Ivanov
On Mon, 22 Jul 2024 14:56:31 GMT, Andrew Haley wrote: >> src/hotspot/share/oops/klass.inline.hpp line 117: >> >>> 115: } >>> 116: >>> 117: inline bool Klass::search_secondary_supers(Klass *k) const { >> >> I see you moved `Klass::search_secondary_supers` in `klass.inline.hpp`, but >> I'm not

Re: RFR: 8336679: Add @implSpec for the default implementations in Process.waitFor() [v2]

2024-07-23 Thread Naoto Sato
> This is a simple doc-only change that follows up > [JDK-8336479](https://bugs.openjdk.org/browse/JDK-8336479). A corresponding > CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Addressing a CSR comment --

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Naoto Sato
On Tue, 23 Jul 2024 18:33:47 GMT, Justin Lu wrote: >> Or a simple `assert` statement, as throwing an Error could change the >> behavior > > Either of the 3 is fine with me. In this case, I think `AssertionError` is > harmless, because AFAICT it is internally used by CompactNumberFormat only, >

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Justin Lu
On Tue, 23 Jul 2024 18:04:54 GMT, Naoto Sato wrote: >> src/java.base/share/classes/java/text/DecimalFormat.java line 1797: >> >>> 1795: case Long l -> digitList.set(isNegative, l, maxDigits); >>> 1796: case BigInteger bi -> digitList.set(isNegative, bi, >>> maxDigits); >

Re: RFR: 8336679: Add @implSpec for the default implementations in Process.waitFor()

2024-07-23 Thread Justin Lu
On Mon, 22 Jul 2024 22:10:07 GMT, Naoto Sato wrote: > This is a simple doc-only change that follows up > [JDK-8336479](https://bugs.openjdk.org/browse/JDK-8336479). A corresponding > CSR has also been drafted. Marked as reviewed by jlu (Committer). - PR Review: https://git.openjd

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Naoto Sato
On Tue, 23 Jul 2024 17:29:10 GMT, Justin Lu wrote: >> As discussed in >> https://github.com/openjdk/jdk/pull/19513#discussion_r1684957942, there is >> code within java.text.NumberFormat (and subclasses) that can use the pattern >> match switch to improve readability. >> >> As this is simply c

Re: RFR: 8336787: Examine java.text.Format API for implSpec usage

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 17:51:04 GMT, Justin Lu wrote: > As discussed in https://bugs.openjdk.org/browse/JDK-8335834, there are > occurrences in the java.text.Format API that would benefit from the implSpec > (and apiNote) tag. > > This is a doc-only change, and a CSR has also been filed. > > I

RFR: 8336787: Examine java.text.Format API for implSpec usage

2024-07-23 Thread Justin Lu
As discussed in https://bugs.openjdk.org/browse/JDK-8335834, there are occurrences in the java.text.Format API that would benefit from the implSpec (and apiNote) tag. This is a doc-only change, and a CSR has also been filed. I did not think "_Subclasses that support fields should override this

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 17:28:02 GMT, Justin Lu wrote: > As discussed in > https://github.com/openjdk/jdk/pull/19513#discussion_r1684957942, there is > code within java.text.NumberFormat (and subclasses) that can use the pattern > match switch to improve readability. > > As this is simply cleanup

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Justin Lu
On Tue, 23 Jul 2024 17:28:02 GMT, Justin Lu wrote: > As discussed in > https://github.com/openjdk/jdk/pull/19513#discussion_r1684957942, there is > code within java.text.NumberFormat (and subclasses) that can use the pattern > match switch to improve readability. > > As this is simply cleanup

RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Justin Lu
As discussed in https://github.com/openjdk/jdk/pull/19513#discussion_r1684957942, there is code within java.text.NumberFormat (and subclasses) that can use the pattern match switch to improve readability. As this is simply cleanup, there is no regression test added. - Commit messa

Re: RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v3]

2024-07-23 Thread Kevin Driver
> Introduce an API for Key Derivation Functions (KDFs), which are cryptographic > algorithms for deriving additional keys from a secret key and other data. See > [JEP 478](https://openjdk.org/jeps/478). > > Work was begun in [another PR](https://github.com/openjdk/jdk/pull/18924). Kevin Driver

Re: RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v2]

2024-07-23 Thread Kevin Driver
> Introduce an API for Key Derivation Functions (KDFs), which are cryptographic > algorithms for deriving additional keys from a secret key and other data. See > [JEP 478](https://openjdk.org/jeps/478). > > Work was begun in [another PR](https://github.com/openjdk/jdk/pull/18924). Kevin Driver

RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview)

2024-07-23 Thread Kevin Driver
Introduce an API for Key Derivation Functions (KDFs), which are cryptographic algorithms for deriving additional keys from a secret key and other data. See [JEP 478](https://openjdk.org/jeps/478). Work was begun in [another PR](https://github.com/openjdk/jdk/pull/18924). - Commit m

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v34]

2024-07-23 Thread fabioromano1
On Tue, 23 Jul 2024 15:16:27 GMT, Raffaello Giulietti wrote: > AFAIU, the wrapper performs the normalization, invokes the core algorithm, > and does the denormalization just before returning the final result. There's > no mention that normalization/denormalization need to be performed at each

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v7]

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 12:56:07 GMT, Shaojin Wen wrote: >> Currently simpleConcat is implemented using mix and prepend, but in this >> simple scenario, it can be implemented in a simpler way and can improve >> performance. > > Shaojin Wen has updated the pull request incrementally with one additio

Re: RFR: 8336754: Remodel TypeAnnotation to "has" instead of "be" an Annotation [v2]

2024-07-23 Thread Chen Liang
On Mon, 22 Jul 2024 16:42:06 GMT, Chen Liang wrote: >> `TypeAnnotation` is not an annotation, as it should not be used in places >> like `AnnotationValue.ofAnnotation`. Thus it's remodeled to contain an >> annotation at a given location instead of to be an annotation. >> >> Depends on #20205.

Re: RFR: 8336754: Remodel TypeAnnotation to "has" instead of "be" an Annotation [v3]

2024-07-23 Thread Chen Liang
> `TypeAnnotation` is not an annotation, as it should not be used in places > like `AnnotationValue.ofAnnotation`. Thus it's remodeled to contain an > annotation at a given location instead of to be an annotation. > > Depends on #20205. Chen Liang has updated the pull request with a new target

Re: RFR: 8336927: Missing equals and hashCode in java.lang.classfile.Annotation [v2]

2024-07-23 Thread Chen Liang
> Convert `AnnotationImpl` to a record so it comes with proper `equals` and > `hashCode` implementations. This also fixes the comparison for > annotation-valued annotation element values. Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The pull request

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v34]

2024-07-23 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 17:22:50 GMT, fabioromano1 wrote: >> I have implemented the Zimmermann's square root algorithm, available in >> works [here](https://inria.hal.science/inria-00072854/en/) and >> [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). >> >> The

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v34]

2024-07-23 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 17:22:50 GMT, fabioromano1 wrote: >> I have implemented the Zimmermann's square root algorithm, available in >> works [here](https://inria.hal.science/inria-00072854/en/) and >> [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). >> >> The

Re: RFR: 8336856: Optimize String Concat [v7]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v34]

2024-07-23 Thread fabioromano1
On Tue, 23 Jul 2024 14:42:36 GMT, Raffaello Giulietti wrote: > AFAIU, in the Bertot, Magaud, Zimmermann paper there is just one > "denormalization" step in the wrapper, before returning the final result to > the client. > > Here, there seems to be a denormalization before returning from each

Re: RFR: 8336856: Optimize String Concat [v6]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v34]

2024-07-23 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 17:22:50 GMT, fabioromano1 wrote: >> I have implemented the Zimmermann's square root algorithm, available in >> works [here](https://inria.hal.science/inria-00072854/en/) and >> [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). >> >> The

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v7]

2024-07-23 Thread Roger Riggs
On Tue, 23 Jul 2024 12:56:07 GMT, Shaojin Wen wrote: >> Currently simpleConcat is implemented using mix and prepend, but in this >> simple scenario, it can be implemented in a simpler way and can improve >> performance. > > Shaojin Wen has updated the pull request incrementally with one additio

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v15]

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 13:42:20 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/StringLatin1.java line 832: >> >>> 830: static void putCharsAt(byte[] val, int index, int c1, int c2, int >>> c3, int c4) { >>> 831: assert index >= 0 && index + 3 < length(val) : "Trusted

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v15]

2024-07-23 Thread Shaojin Wen
On Tue, 23 Jul 2024 13:25:16 GMT, Chen Liang wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> replace unsafe with putChar > > src/java.base/share/classes/java/lang/StringLatin1.java line 832: > >> 830: static vo

Re: RFR: 8336856: Optimize String Concat

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 09:02:48 GMT, Shaojin Wen wrote: > The ClassData of LambdaMetafactory has only one MethodHandle, but multiple > MethodHandles are needed here. In these cases, we pass a `List.of(methodHandles)`, and call extra `.constantInstruction(index).invokeinterface(CD_List, "get", MTD

Re: RFR: 8336856: Optimize String Concat [v5]

2024-07-23 Thread Claes Redestad
On Tue, 23 Jul 2024 12:22:57 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v15]

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 12:57:52 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) methods so that >> these two meth

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]

2024-07-23 Thread Chen Liang
On Fri, 19 Jul 2024 21:46:07 GMT, Roger Riggs wrote: >> Shaojin Wen has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Update src/java.base/share/classes/java/lang/String.java >> >>Co-authored-by: Chen Liang >> - add comments >

Re: RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v16]

2024-07-23 Thread Jan Kratochvil
> The testcase requires root permissions. > > Fix by Severin Gehwolf. > Testcase by Jan Kratochvil. Jan Kratochvil has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 117 commits: - Fix testcase compatibility with Alpine Linux 3.20.1

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v7]

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 12:56:07 GMT, Shaojin Wen wrote: >> Currently simpleConcat is implemented using mix and prepend, but in this >> simple scenario, it can be implemented in a simpler way and can improve >> performance. > > Shaojin Wen has updated the pull request incrementally with one additio

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]

2024-07-23 Thread Claes Redestad
On Tue, 23 Jul 2024 12:49:52 GMT, Shaojin Wen wrote: >> Yes, this isn't beholden to JLS 15.18.1, and it's already specified that >> `foo.concat("")` returns `foo` - so why shouldn't `"".concat(foo)` return >> `foo`? But still it's an observable semantic change so some care needs to be >> taken

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v7]

2024-07-23 Thread Claes Redestad
On Tue, 23 Jul 2024 12:56:07 GMT, Shaojin Wen wrote: >> Currently simpleConcat is implemented using mix and prepend, but in this >> simple scenario, it can be implemented in a simpler way and can improve >> performance. > > Shaojin Wen has updated the pull request incrementally with one additio

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v15]

2024-07-23 Thread Shaojin Wen
> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into > primitive arrays by combining values ​​into larger stores. > > This PR rewrites the code of appendNull and append(boolean) methods so that > these two methods can be optimized by C2. Shaojin Wen has updated the pul

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]

2024-07-23 Thread Shaojin Wen
On Tue, 23 Jul 2024 12:37:40 GMT, Claes Redestad wrote: >> The spec for concat only asked for equal representation instead of the >> existence of a new identity. Thus this should be fine. > > Yes, this isn't beholden to JLS 15.18.1, and it's already specified that > `foo.concat("")` returns `fo

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v7]

2024-07-23 Thread Shaojin Wen
> Currently simpleConcat is implemented using mix and prepend, but in this > simple scenario, it can be implemented in a simpler way and can improve > performance. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: reduce change --

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]

2024-07-23 Thread Claes Redestad
On Tue, 23 Jul 2024 12:12:41 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/String.java line 2991: >> >>> 2989: } >>> 2990: if (isEmpty()) { >>> 2991: return str; >> >> This case should probably be reflected more precisely in the specification, >> o

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v6]

2024-07-23 Thread Coleen Phillimore
On Mon, 15 Jul 2024 00:44:02 GMT, Axel Boldt-Christmas wrote: >> src/hotspot/share/oops/instanceKlass.cpp line 1090: >> >>> 1088: >>> 1089: // Step 2 >>> 1090: // If we were to use wait() instead of waitUninterruptibly() then >> >> This is a nice correction (even though, the actual ca

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v6]

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 12:16:00 GMT, Shaojin Wen wrote: >> Currently simpleConcat is implemented using mix and prepend, but in this >> simple scenario, it can be implemented in a simpler way and can improve >> performance. > > Shaojin Wen has updated the pull request with a new target base due to

Integrated: 8204582: Extra spaces in jlink documentation make it incorrect.

2024-07-23 Thread Athijegannathan Sundararajan
On Tue, 23 Jul 2024 04:55:16 GMT, Athijegannathan Sundararajan wrote: > removed extra whitespaces This pull request has now been integrated. Changeset: 0e555b5d Author:Athijegannathan Sundararajan URL: https://git.openjdk.org/jdk/commit/0e555b5ded819cc3b363673320dc848c321861ce Stat

Re: RFR: 8336856: Optimize String Concat [v5]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336856: Optimize String Concat [v4]

2024-07-23 Thread Shaojin Wen
On Tue, 23 Jul 2024 10:19:47 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 12:01:51 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Update src/java.base/share/classes/java/lang/String.java >> >>Co-authored-by: Chen Liang >> - add comments

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v6]

2024-07-23 Thread Shaojin Wen
> Currently simpleConcat is implemented using mix and prepend, but in this > simple scenario, it can be implemented in a simpler way and can improve > performance. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commi

Integrated: 8335939: Hide element writing across the ClassFile API

2024-07-23 Thread Chen Liang
On Tue, 16 Jul 2024 23:50:17 GMT, Chen Liang wrote: > `WritableElement` has always been one of the biggest peculiarities of > ClassFile API: it exposes element writing yet has no corresponding reading > ability exposed. Its existence creates a lot of API noise, increasing > maintenance cost in

Re: RFR: 8335939: Hide element writing across the ClassFile API [v5]

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 05:40:05 GMT, Chen Liang wrote: >> `WritableElement` has always been one of the biggest peculiarities of >> ClassFile API: it exposes element writing yet has no corresponding reading >> ability exposed. Its existence creates a lot of API noise, increasing >> maintenance cos

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]

2024-07-23 Thread Claes Redestad
On Fri, 19 Jul 2024 21:42:09 GMT, Shaojin Wen wrote: >> Currently simpleConcat is implemented using mix and prepend, but in this >> simple scenario, it can be implemented in a simpler way and can improve >> performance. > > Shaojin Wen has updated the pull request incrementally with two additio

Re: RFR: 8335182: Consolidate and streamline String concat code shapes [v3]

2024-07-23 Thread Claes Redestad
On Tue, 9 Jul 2024 21:16:33 GMT, Claes Redestad wrote: >> This PR attains a speed-up on some microbenchmarks by simplifying how we >> build up the MH combinator tree shape >> (only use prependers with prefix, always add a suffix to the newArray >> combinator), then simplifying/inlining some of

Integrated: 8335182: Consolidate and streamline String concat code shapes

2024-07-23 Thread Claes Redestad
On Thu, 27 Jun 2024 12:27:26 GMT, Claes Redestad wrote: > This PR attains a speed-up on some microbenchmarks by simplifying how we > build up the MH combinator tree shape > (only use prependers with prefix, always add a suffix to the newArray > combinator), then simplifying/inlining some of the

Re: RFR: 8204582: Extra spaces in jlink documentation make it incorrect. [v2]

2024-07-23 Thread Alan Bateman
On Tue, 23 Jul 2024 09:42:52 GMT, Athijegannathan Sundararajan wrote: >> removed extra whitespaces > > Athijegannathan Sundararajan has updated the pull request incrementally with > one additional commit since the last revision: > > removed space in --limit-modules option as well (review com

Re: RFR: 8336856: Optimize String Concat [v4]

2024-07-23 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8336254: Virtual thread implementation + test updates [v2]

2024-07-23 Thread Kevin Walls
On Fri, 19 Jul 2024 16:59:54 GMT, Alan Bateman wrote: >> Bringover some of the changes accumulated in the loom repo to the main line, >> most of these changes are test updates and have been baking in the loom repo >> for several months. The motive is partly to reduce the large set of changes >

Re: RFR: 8204582: Extra spaces in jlink documentation make it incorrect. [v2]

2024-07-23 Thread Athijegannathan Sundararajan
> removed extra whitespaces Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last revision: removed space in --limit-modules option as well (review comment) - Changes: - all: https://git.openjdk.org/jdk/pull/20292/file

Re: RFR: 8336856: Optimize String Concat

2024-07-23 Thread Shaojin Wen
On Mon, 22 Jul 2024 14:27:39 GMT, Chen Liang wrote: > For the question > [here](https://github.com/openjdk/jdk/pull/20253#issuecomment-2242267516): > > 1. A sample of loading an otherwise inaccessible method handle from class > data: > https://github.com/openjdk/jdk/blob/c3226aaeb810521257e96

Integrated: 8334758: Incorrect note in Javadoc for a few RandomGenerator methods

2024-07-23 Thread Raffaello Giulietti
On Fri, 12 Jul 2024 06:28:15 GMT, Raffaello Giulietti wrote: > Small corrections to @implSpec notes in a few methods in RandomGenerator. This pull request has now been integrated. Changeset: 4c7b3e7f Author:Raffaello Giulietti URL: https://git.openjdk.org/jdk/commit/4c7b3e7fc39a06e

Re: RFR: 8335939: Hide element writing across the ClassFile API [v5]

2024-07-23 Thread Adam Sotona
On Tue, 23 Jul 2024 05:40:05 GMT, Chen Liang wrote: >> `WritableElement` has always been one of the biggest peculiarities of >> ClassFile API: it exposes element writing yet has no corresponding reading >> ability exposed. Its existence creates a lot of API noise, increasing >> maintenance cos

Re: RFR: 8336927: Missing equals and hashCode in java.lang.classfile.Annotation

2024-07-23 Thread Adam Sotona
On Tue, 23 Jul 2024 04:44:57 GMT, Chen Liang wrote: > Convert `AnnotationImpl` to a record so it comes with proper `equals` and > `hashCode` implementations. This also fixes the comparison for > annotation-valued annotation element values. Looks good to me, thanks for the fix. -