Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread ExE Boss
On Mon, 17 Apr 2023 13:00:36 GMT, Aleksey Shipilev wrote: >> src/java.base/share/classes/java/lang/Enum.java line 191: >> >>> 189: int hc = hash; >>> 190: if (hc == 0) { >>> 191: hc = hash = System.identityHashCode(this); >> >> Why not `hc = hash =

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Joe Darcy
On Mon, 17 Apr 2023 20:46:36 GMT, Doug Simon wrote: > > From the long-term perspective, it is likely that the set of kinds of > > elements that can occur in an annotation will be expanded, for example, > > method references are a repeated request. Easing future maintenance to > > gives more

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Joe Darcy
On Mon, 17 Apr 2023 20:33:30 GMT, Doug Simon wrote: >> src/java.base/share/classes/jdk/internal/vm/VMSupport.java line 234: >> >>> 232: * Encodes a list of annotations to a byte array. The byte array >>> can be decoded with {@link #decodeAnnotations(byte[], AnnotationDecoder)}. >>> 233:

Re: RFR: 8266571: Sequenced Collections [v4]

2023-04-17 Thread Stuart Marks
On Thu, 30 Mar 2023 11:33:14 GMT, Chen Liang wrote: >> In the JEP: >>> A sequenced collection supports common operations at either end, and it >>> supports processing the elements from first to last and from last to first >>> (i.e., forward and reverse). >> >>> The reverse-ordered view

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-17 Thread Stuart Marks
On Sat, 25 Mar 2023 07:34:51 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > >

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-17 Thread Stuart Marks
On Sat, 25 Mar 2023 07:28:46 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > >

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-17 Thread Stuart Marks
On Sat, 25 Mar 2023 07:15:16 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > >

Re: RFR: 8266571: Sequenced Collections [v5]

2023-04-17 Thread Stuart Marks
On Thu, 30 Mar 2023 09:50:51 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/util/LinkedHashMap.java line 1197: >> >>> 1195: >>> 1196: public V computeIfAbsent(K key, Function>> V> mappingFunction) { >>> 1197: return base.computeIfAbsent(key,

Re: RFR: 8266571: Sequenced Collections [v5]

2023-04-17 Thread Stuart Marks
On Tue, 28 Mar 2023 01:28:16 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/LinkedHashMap.java line 1123: >> >>> 1121: >>> 1122: public V put(K key, V value) { >>> 1123: return base.put(key, value); >> >> Why `put()` simply delegates to `base.put()`

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread John R Rose
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8304896: Update to use jtreg 7.2

2023-04-17 Thread Iris Clark
On Mon, 17 Apr 2023 14:56:16 GMT, Christian Stein wrote: > Please review the change to update to using jtreg 7.2. > > The primary change is to the `jib-profiles.js` file, which specifies the > version of jtreg to use, for those systems that rely on this file. In > addition, the

Re: RFR: 8304896: Update to use jtreg 7.2

2023-04-17 Thread Leonid Mesnik
On Mon, 17 Apr 2023 14:56:16 GMT, Christian Stein wrote: > Please review the change to update to using jtreg 7.2. > > The primary change is to the `jib-profiles.js` file, which specifies the > version of jtreg to use, for those systems that rely on this file. In > addition, the

Re: RFR: 8304932: MethodTypeDescImpl can be mutated by argument passed to MethodTypeDesc.of [v2]

2023-04-17 Thread Chen Liang
On Mon, 17 Apr 2023 21:04:31 GMT, Mandy Chung wrote: > Have you considered that the caller of instantiating `MethodTypeDescImpl` is > responsible for passing a trusted array? I think that `MethodTypeDescImpl` > implementation already assumes it's a trusted array. So `MethodTypeDesc::of` > to

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v2]

2023-04-17 Thread Jorn Vernee
On Mon, 17 Apr 2023 13:40:02 GMT, Claes Redestad wrote: > > > Why isn't `Enum::hashCode` simply doing `return ordinal;`? > > > > > > See https://bugs.openjdk.org/browse/JDK-8050217 > > Thanks! If there are apps where `Enum::hashCode` is performance sensitive > then run-to-run stability may

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails

2023-04-17 Thread Chen Liang
On Fri, 14 Apr 2023 14:02:46 GMT, Adam Sotona wrote: > Classfile API didn't handle transformations of class files version 50 and > below correctly. > > Proposed fix have two parts: > 1. Inflation of branch targets does not depend on StackMapTable attribute > presence for class file version

Re: RFR: 8304932: MethodTypeDescImpl can be mutated by argument passed to MethodTypeDesc.of [v2]

2023-04-17 Thread Mandy Chung
On Sun, 26 Mar 2023 20:45:19 GMT, Chen Liang wrote: >> Fixed the bug where if a caller keeps a reference to the array passed into >> `MethodTypeDesc.of`, the caller may mutate the Desc via the array and can >> create invalid MethodTypeDesc. >> >> Unfortunately, since the input array now needs

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v8]

2023-04-17 Thread Doug Simon
> This PR extends JVMCI with new API (`jdk.vm.ci.meta.Annotated`) for accessing > annotations. The main differences from `java.lang.reflect.AnnotatedElement` > are: > * All methods in the `Annotated` interface explicitly specify requested > annotation type(s). That is, there is no equivalent of

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Doug Simon
On Mon, 17 Apr 2023 16:50:47 GMT, Joe Darcy wrote: > the methods should phrase their operations in terms of these concepts... I think this is what you're suggesting: https://github.com/openjdk/jdk/pull/12810/commits/362738a61410cc8d60d8c4c4fc9e3e8ed0393aed - PR Comment:

Re: RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v15]

2023-04-17 Thread Roger Riggs
> Define an internal jdk.internal.util.Architecture enumeration and static > methods to replace uses of the system property `os.arch`. > The enumeration values are defined to match those used in the build. > The initial values are: `X64, X86, AARCH64, RISCV64, S390, PPC64` > Note that `amd64` and

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Doug Simon
On Mon, 17 Apr 2023 16:50:47 GMT, Joe Darcy wrote: > From the long-term perspective, it is likely that the set of kinds of > elements that can occur in an annotation will be expanded, for example, > method references are a repeated request. Easing future maintenance to gives > more

Integrated: 8305762: FileInputStream and FileOutputStream implSpec should be corrected or removed

2023-04-17 Thread Brent Christian
On Tue, 11 Apr 2023 23:55:50 GMT, Brent Christian wrote: > With the removal of the AltFinalizer mechanism from `FileInputStream` and > `FileOutputStream` in > [JDK-8192939](https://bugs.openjdk.org/browse/JDK-8192939), this portion of > the Implementation Requirement in the class JavaDoc is

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Doug Simon
On Mon, 17 Apr 2023 20:33:26 GMT, Doug Simon wrote: >> src/java.base/share/classes/jdk/internal/vm/VMSupport.java line 234: >> >>> 232: * Encodes a list of annotations to a byte array. The byte array >>> can be decoded with {@link #decodeAnnotations(byte[], AnnotationDecoder)}. >>> 233:

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Doug Simon
On Mon, 17 Apr 2023 15:32:56 GMT, Joe Darcy wrote: >> Doug Simon has updated the pull request incrementally with one additional >> commit since the last revision: >> >> [skip ci] formatting fixes > > src/java.base/share/classes/jdk/internal/vm/VMSupport.java line 234: > >> 232: *

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Doug Simon
On Mon, 17 Apr 2023 15:48:53 GMT, Joe Darcy wrote: >> Doug Simon has updated the pull request incrementally with one additional >> commit since the last revision: >> >> [skip ci] formatting fixes > > src/java.base/share/classes/jdk/internal/vm/VMSupport.java line 419: > >> 417: *

Re: RFR: 8305762: FileInputStream and FileOutputStream implSpec should be corrected or removed [v3]

2023-04-17 Thread Alan Bateman
On Mon, 17 Apr 2023 18:56:06 GMT, Brent Christian wrote: >> With the removal of the AltFinalizer mechanism from `FileInputStream` and >> `FileOutputStream` in >> [JDK-8192939](https://bugs.openjdk.org/browse/JDK-8192939), this portion of >> the Implementation Requirement in the class JavaDoc

Re: RFR: 8305762: FileInputStream and FileOutputStream implSpec should be corrected or removed [v3]

2023-04-17 Thread Brian Burkhalter
On Mon, 17 Apr 2023 18:56:06 GMT, Brent Christian wrote: >> With the removal of the AltFinalizer mechanism from `FileInputStream` and >> `FileOutputStream` in >> [JDK-8192939](https://bugs.openjdk.org/browse/JDK-8192939), this portion of >> the Implementation Requirement in the class JavaDoc

Re: RFR: 8305762: FileInputStream and FileOutputStream implSpec should be corrected or removed [v2]

2023-04-17 Thread Brent Christian
On Sat, 15 Apr 2023 07:10:46 GMT, Alan Bateman wrote: >> Brent Christian has updated the pull request incrementally with one >> additional commit since the last revision: >> >> updates, per review comments > > src/java.base/share/classes/java/io/FileInputStream.java line 45: > >> 43: *

Re: RFR: 8305762: FileInputStream and FileOutputStream implSpec should be corrected or removed [v3]

2023-04-17 Thread Brent Christian
> With the removal of the AltFinalizer mechanism from `FileInputStream` and > `FileOutputStream` in > [JDK-8192939](https://bugs.openjdk.org/browse/JDK-8192939), this portion of > the Implementation Requirement in the class JavaDoc is no longer true: > >> If this FileOutputStream has been

Re: RFR: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage

2023-04-17 Thread Raffaello Giulietti
On Wed, 29 Mar 2023 18:09:22 GMT, Raffaello Giulietti wrote: > When appropriate and useful, copies only the relevant portion of the > `CharSequence` to the match result. @stuart-marks As the reporter of the issue, would this interest you? - PR Comment:

Re: RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v13]

2023-04-17 Thread Roger Riggs
On Sat, 15 Apr 2023 17:17:13 GMT, Glavo wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fixed isPPC64(). >> Consolidated switch cases in ArchTest. >> Moved mapping of build TARGET_OS and TARGET_CPU to the build

Re: RFR: 8305945: (zipfs) Opening a directory to get input stream produces incorrect exception message [v5]

2023-04-17 Thread Eirik Bjorsnos
On Mon, 17 Apr 2023 17:04:32 GMT, Alan Bateman wrote: > What you have is fine, I'm just making the point that the exception message > is somewhat secondary I guess this is also a question of testing the interface vs. testing the implementation. To get good coverage of validation scenarios, I

Re: RFR: 8305734: BitSet.get(int, int) always returns the empty BitSet when the Integer.MAX VALUE is set

2023-04-17 Thread Stuart Marks
On Fri, 7 Apr 2023 12:22:03 GMT, Andy-Tatman wrote: > See https://bugs.java.com/bugdatabase/view_bug?bug_id=8305734 The workaround mentioned in JDK-8230557 applies to `size()` and not `length()`. (But `length()` probably has similar behavior to `size()`.) Moreover, this is only a workaround,

Re: Draft: Deprecate toLowerCase()/toUpperCase() and provide locale insensitive alternative

2023-04-17 Thread Stuart Marks
On 4/16/23 8:47 AM, Glavo wrote: I understand that Java 21 is around the corner and you have a lot of work to do, so I'm sorry for taking up so much of your time. But for this issue, I think it really needs to be corrected. If new APIs cannot be added in Java 21, it means that correcting

Re: RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v14]

2023-04-17 Thread Roger Riggs
> Define an internal jdk.internal.util.Architecture enumeration and static > methods to replace uses of the system property `os.arch`. > The enumeration values are defined to match those used in the build. > The initial values are: `X64, X86, AARCH64, RISCV64, S390, PPC64` > Note that `amd64` and

Re: RFR: 8305945: (zipfs) Opening a directory to get input stream produces incorrect exception message [v5]

2023-04-17 Thread Alan Bateman
On Sun, 16 Apr 2023 10:27:07 GMT, Lance Andersen wrote: >> Okay, although I assume this test will fail if it throws a more general >> IOException (it's allowed to do that) or there is any adjustment to the >> error message. > > Yes, in the unlikely event that either FileSystemException or

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Joe Darcy
On Fri, 17 Mar 2023 15:38:49 GMT, Doug Simon wrote: >> This PR extends JVMCI with new API (`jdk.vm.ci.meta.Annotated`) for >> accessing annotations. The main differences from >> `java.lang.reflect.AnnotatedElement` are: >> * All methods in the `Annotated` interface explicitly specify requested

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 16:44:24 GMT, Aleksey Shipilev wrote: > I am okay with this new version, thanks. (You need other commenters to > approve as well.) While there's already one more reviewer who approved this PR (@cl4es) and technically it can be already integrated, I'd leave it for a day or

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread Roger Riggs
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread olivergillespie
> Improve the speed of Enum.hashCode by caching the identity hashcode on first > use. I've seen an application where Enum.hashCode is a hot path, and this is > fairly simple speedup. The memory overhead is low; in enums with no extra > fields there is already a 4-byte space due to alignment so

Integrated: 8296248: Update CLDR to Version 43.0

2023-04-17 Thread Naoto Sato
On Thu, 13 Apr 2023 20:20:02 GMT, Naoto Sato wrote: > Upgrading the CLDR to [version > 43](https://cldr.unicode.org/index/downloads/cldr-43). This semi-annual > release is their `limited-submission` release so I would not expect > regressions caused by formatting changes as we had in

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 15:41:34 GMT, olivergillespie wrote: >> Yes, it is a bit strange to see @implNote here as this is a private field >> that isn't going to show up in the javadoc. The javadoc for non-transient >> fields in Serializable classes does show up in the Serialized Form page but >>

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v5]

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 15:55:38 GMT, Aleksey Shipilev wrote: >> olivergillespie has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Switch to non-javadoc comment and remove markup > > src/java.base/share/classes/java/lang/Enum.java line 171: >

Re: RFR: 8304896: Update to use jtreg 7.2

2023-04-17 Thread Erik Joelsson
On Mon, 17 Apr 2023 14:56:16 GMT, Christian Stein wrote: > Please review the change to update to using jtreg 7.2. > > The primary change is to the `jib-profiles.js` file, which specifies the > version of jtreg to use, for those systems that rely on this file. In > addition, the

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v5]

2023-04-17 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 15:54:30 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread olivergillespie
On Mon, 17 Apr 2023 14:15:39 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v5]

2023-04-17 Thread olivergillespie
> Improve the speed of Enum.hashCode by caching the identity hashcode on first > use. I've seen an application where Enum.hashCode is a hot path, and this is > fairly simple speedup. The memory overhead is low; in enums with no extra > fields there is already a 4-byte space due to alignment so

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Joe Darcy
On Fri, 17 Mar 2023 15:38:49 GMT, Doug Simon wrote: >> This PR extends JVMCI with new API (`jdk.vm.ci.meta.Annotated`) for >> accessing annotations. The main differences from >> `java.lang.reflect.AnnotatedElement` are: >> * All methods in the `Annotated` interface explicitly specify requested

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread olivergillespie
On Mon, 17 Apr 2023 15:30:52 GMT, Alan Bateman wrote: >> I would change this to be an non-javadoc comment. (Change /** to /*) >> An there is no need for javadoc \implNote or @link javadoc markup. >> There is very little value in being able to generate javadoc for --private. >> (In part because

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Joe Darcy
On Fri, 17 Mar 2023 15:38:49 GMT, Doug Simon wrote: >> This PR extends JVMCI with new API (`jdk.vm.ci.meta.Annotated`) for >> accessing annotations. The main differences from >> `java.lang.reflect.AnnotatedElement` are: >> * All methods in the `Annotated` interface explicitly specify requested

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread Alan Bateman
On Mon, 17 Apr 2023 15:18:12 GMT, Roger Riggs wrote: >>> The @implNote is more appropriate for an internal comment. It is not needed >>> to be in the published javadoc; its only useful to someone viewing the >>> source code. >> >> Is it a comment to me or to the author? If it's the former,

Re: RFR: 8305762: FileInputStream and FileOutputStream implSpec should be corrected or removed [v2]

2023-04-17 Thread Brian Burkhalter
On Fri, 14 Apr 2023 22:27:26 GMT, Brent Christian wrote: >> With the removal of the AltFinalizer mechanism from `FileInputStream` and >> `FileOutputStream` in >> [JDK-8192939](https://bugs.openjdk.org/browse/JDK-8192939), this portion of >> the Implementation Requirement in the class JavaDoc

Re: RFR: 8303431: [JVMCI] libgraal annotation API [v7]

2023-04-17 Thread Joe Darcy
On Fri, 17 Mar 2023 15:38:49 GMT, Doug Simon wrote: >> This PR extends JVMCI with new API (`jdk.vm.ci.meta.Annotated`) for >> accessing annotations. The main differences from >> `java.lang.reflect.AnnotatedElement` are: >> * All methods in the `Annotated` interface explicitly specify requested

Re: RFR: 8300818: Reduce complexity of padding with DateTimeFormatter [v2]

2023-04-17 Thread Roger Riggs
On Sun, 16 Apr 2023 11:44:52 GMT, Sergey Tsypanov wrote: >> Special casing for len == 0 and keeping the existing buf.insert for len == 1 >> would avoid object creation except when it would improve performance. > > @RogerRiggs sorry I don't get it. Maybe you mean speacial casing for > `padWidth

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread Roger Riggs
On Mon, 17 Apr 2023 15:05:46 GMT, Pavel Rappo wrote: >> The @implNote is more appropriate for an internal comment. It is not needed >> to be in the published javadoc; its only useful to someone viewing the >> source code. > >> The @implNote is more appropriate for an internal comment. It is

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 14:56:13 GMT, Roger Riggs wrote: > The @implNote is more appropriate for an internal comment. It is not needed > to be in the published javadoc; its only useful to someone viewing the source > code. Is it a comment to me or to the author? If it's the former, then I note,

RFR: 8304896: Update to use jtreg 7.2

2023-04-17 Thread Christian Stein
Please review the change to update to using jtreg 7.2. The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. -

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread Roger Riggs
On Mon, 17 Apr 2023 14:23:01 GMT, Pavel Rappo wrote: >> olivergillespie has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix two typos > > src/java.base/share/classes/java/lang/Enum.java line 177: > >> 175: * HotSpot's identity

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 13:49:11 GMT, Aleksey Shipilev wrote: >> From that impl note it seemed like it was a big deal for hash code to never >> return 0 for an object. Could you maybe de-emphasize the importance of that >> HotSpot behavior in the note? > > All right, we can change "This allows to

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread Roger Riggs
On Mon, 17 Apr 2023 14:15:39 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 14:15:39 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v4]

2023-04-17 Thread olivergillespie
> Improve the speed of Enum.hashCode by caching the identity hashcode on first > use. I've seen an application where Enum.hashCode is a hot path, and this is > fairly simple speedup. The memory overhead is low; in enums with no extra > fields there is already a 4-byte space due to alignment so

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread Chen Liang
On Mon, 17 Apr 2023 13:45:05 GMT, Andrei Pangin wrote: >> olivergillespie has refreshed the contents of this pull request, and >> previous commits have been removed. Incremental views are not available. The >> pull request now contains one commit: >> >> 8306075: Micro-optimize Enum.hashCode

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 13:27:43 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 13:45:16 GMT, Pavel Rappo wrote: >> It would not break the code functionally if that invariant ever breaks: we >> would "just" call the (intrinsic) method on zero hash code. That `implNote` >> only shows that it would not happen with current implementation at all. > > From

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread Andrei Pangin
On Mon, 17 Apr 2023 13:27:43 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 13:08:41 GMT, Aleksey Shipilev wrote: >> Yes, it is implementation-specific, that is why it says "Hotspot's identity >> hash code". The relevant code blocks are >>

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

2023-04-17 Thread Adam Sotona
On Sat, 1 Apr 2023 20:31:05 GMT, Chen Liang wrote: > It's quite complicated to safeguard every potentially erroneous call. I agree, it is complicated, however possible. The question however is whether it is desirable. See for example silently failing `ClhsdbDumpclass` test with many

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

2023-04-17 Thread Chen Liang
On Tue, 29 Nov 2022 10:26:31 GMT, Adam Sotona wrote: > javap uses proprietary com.sun.tools.classfile library to parse class files. > > This patch converts javap to use Classfile API. > > Please review. > > Thanks, > Adam I took a look at this patch locally; 4 of the javap tests fail. The

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

2023-04-17 Thread Adam Sotona
On Tue, 29 Nov 2022 10:26:31 GMT, Adam Sotona wrote: > javap uses proprietary com.sun.tools.classfile library to parse class files. > > This patch converts javap to use Classfile API. > > Please review. > > Thanks, > Adam failing `hotspot/jtreg/serviceability/sa/ClhsdbDumpclass.java` test is

RFR: 8294969: Convert jdk.jdeps javap to use the Classfile API

2023-04-17 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 - Commit messages: - fixed TestClassNameWarning - Merge branch 'master' into JDK-8294969-javap - consolidated safeguarding of

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v2]

2023-04-17 Thread Claes Redestad
On Mon, 17 Apr 2023 13:27:43 GMT, olivergillespie wrote: > > Why isn't `Enum::hashCode` simply doing `return ordinal;`? > > See https://bugs.openjdk.org/browse/JDK-8050217 Thanks! If there are apps where `Enum::hashCode` is performance sensitive then run-to-run stability may be a stronger

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread Claes Redestad
On Mon, 17 Apr 2023 13:27:43 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v2]

2023-04-17 Thread olivergillespie
On Mon, 17 Apr 2023 13:26:49 GMT, Claes Redestad wrote: > Why isn't `Enum::hashCode` simply doing `return ordinal;`? See https://bugs.openjdk.org/browse/JDK-8050217 - PR Comment: https://git.openjdk.org/jdk/pull/13491#issuecomment-1511350037

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread olivergillespie
On Mon, 17 Apr 2023 13:27:43 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v2]

2023-04-17 Thread Claes Redestad
On Mon, 17 Apr 2023 13:23:35 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v3]

2023-04-17 Thread olivergillespie
> Improve the speed of Enum.hashCode by caching the identity hashcode on first > use. I've seen an application where Enum.hashCode is a hot path, and this is > fairly simple speedup. The memory overhead is low; in enums with no extra > fields there is already a 4-byte space due to alignment so

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v2]

2023-04-17 Thread olivergillespie
> Improve the speed of Enum.hashCode by caching the identity hashcode on first > use. I've seen an application where Enum.hashCode is a hot path, and this is > fairly simple speedup. The memory overhead is low; in enums with no extra > fields there is already a 4-byte space due to alignment so

Re: RFR: 8306075: Micro-optimize Enum.hashCode

2023-04-17 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 12:58:57 GMT, Aleksey Shipilev wrote: >> src/java.base/share/classes/java/lang/Enum.java line 175: >> >>> 173: * >>> 174: * @implNote Once initialized, the field value does not change. >>> 175: * Hotspot's identity hash code generation also never returns zero

Re: RFR: 8306075: Micro-optimize Enum.hashCode

2023-04-17 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 12:14:55 GMT, Pavel Rappo wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra >>

Re: RFR: 8306075: Micro-optimize Enum.hashCode

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 10:59:34 GMT, olivergillespie wrote: > Improve the speed of Enum.hashCode by caching the identity hashcode on first > use. I've seen an application where Enum.hashCode is a hot path, and this is > fairly simple speedup. The memory overhead is low; in enums with no extra >

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch

2023-04-17 Thread Maurizio Cimadamore
On Fri, 17 Mar 2023 12:15:58 GMT, Jan Lahoda wrote: > This is the first draft of a patch for JEP 440 and JEP 441. Changes included: > > - the pattern matching for switch and record patterns features are made > final, together with updates to tests. > - parenthesized patterns are removed. >

RFR: 8306075: Micro-optimize Enum.hashCode

2023-04-17 Thread olivergillespie
Improve the speed of Enum.hashCode by caching the identity hashcode on first use. I've seen an application where Enum.hashCode is a hot path, and this is fairly simple speedup. The memory overhead is low; in enums with no extra fields there is already a 4-byte space due to alignment so this new

Re: RFR: 8304932: MethodTypeDescImpl can be mutated by argument passed to MethodTypeDesc.of [v2]

2023-04-17 Thread Adam Sotona
On Sun, 26 Mar 2023 20:45:19 GMT, Chen Liang wrote: >> Fixed the bug where if a caller keeps a reference to the array passed into >> `MethodTypeDesc.of`, the caller may mutate the Desc via the array and can >> create invalid MethodTypeDesc. >> >> Unfortunately, since the input array now needs

Re: RFR: 8306038: SystemModulesPlugin: Keep stack clean

2023-04-17 Thread Alan Bateman
On Wed, 12 Apr 2023 09:18:13 GMT, Oliver Kopp wrote: > This refs [https://bugs.openjdk.org/browse/JDK-8306038](8306038). > > (Before this referenced 8240567) > > Although this change is rather small, I think, it's good to have a "more > clean" SystemModulesPlugin available. This looks okay.