Re: RFR: 8333265: De-duplicate method references in java.util.stream.FindOps [v3]

2024-06-18 Thread Claes Redestad
> Extracting duplicate method references to static field reduce proxy class > spinning and loading. In this case 2 less classes loaded when using > `findAny()` on each type of stream. Claes Redestad has updated the pull request incrementally with one additional commit since the last

Re: RFR: 8333265: De-duplicate method references in java.util.stream.FindOps [v2]

2024-06-18 Thread Claes Redestad
> Extracting duplicate method references to static field reduce proxy class > spinning and loading. In this case 2 less classes loaded when using > `findAny()` on each type of stream. Claes Redestad has updated the pull request incrementally with one additional commit since the last

RFR: 8334437: De-duplicate ProxyMethod list creation

2024-06-18 Thread Claes Redestad
Simple refactoring to extract identical, simple lambda expressions. Improve code clarity and reduce classes generated. - Commit messages: - Simplify - Refactor ProxyMethod list creation Changes: https://git.openjdk.org/jdk/pull/19760/files Webrev: https://webrevs.openjdk.org/?re

Re: RFR: 8334328: Reduce object allocation for FloatToDecimal and DoubleToDecimal [v8]

2024-06-16 Thread Claes Redestad
On Sat, 15 Jun 2024 13:27:41 GMT, Shaojin Wen wrote: >> The current versions of FloatToDecimal and DoubleToDecimal allocate >> additional objects. Reducing these allocations can improve the performance >> of Float/Double.toString and AbstractStringBuilder's append(float/double). >> >> This pat

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

2024-06-13 Thread Claes Redestad
On Thu, 13 Jun 2024 02:06:42 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: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v18]

2024-06-13 Thread Claes Redestad
On Thu, 6 Jun 2024 11:41:05 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - reverted static initialization of ConstantPoolBuilder and CP entries >> - fixed naming conventions > > src/java.base/sha

Re: RFR: 8333854: IllegalAccessError with proxies after JDK-8332457 [v4]

2024-06-13 Thread Claes Redestad
On Wed, 12 Jun 2024 22:00:45 GMT, Chen Liang wrote: >> Please review this patch that fixes a critical issue that breaks some Proxy >> usages. >> >> Since the problematic patch from before cannot be backed out, this patch >> aims to emulate the old behavior before. A diff between before the >>

Re: RFR: 8333854: IllegalAccessError with proxies after JDK-8332457 [v2]

2024-06-12 Thread Claes Redestad
On Mon, 10 Jun 2024 04:08:41 GMT, Chen Liang wrote: >> Please review this patch that fixes a critical issue that breaks some Proxy >> usages. >> >> CONSTANT_Class and CONSTANT_MethodType must fail resolution for inaccessible >> package-private types per JVMS 5.4.3.1 and 5.4.3.5, yet such types

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

2024-06-12 Thread Claes Redestad
On Wed, 12 Jun 2024 13:38:21 GMT, Shaojin Wen wrote: > In the AbstractStringBuilder#appendNull method, is it possible to not check > the bounds based on the information from ensureCapacityInternal? Perhaps you'd need something like a `Preconditions.checkIndex` in or before the 4-char `StringUT

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

2024-06-12 Thread Claes Redestad
On Tue, 11 Jun 2024 11:35:28 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: 8333893: Optimization for StringBuilder append boolean & null [v4]

2024-06-12 Thread Claes Redestad
On Tue, 11 Jun 2024 11:35:28 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: 8333893: Optimization for StringBuilder append boolean & null [v4]

2024-06-12 Thread Claes Redestad
On Tue, 11 Jun 2024 11:35:28 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: 8333893: Optimization for StringBuilder append boolean & null [v4]

2024-06-12 Thread Claes Redestad
On Tue, 11 Jun 2024 11:35:28 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: 8333893: Optimization for StringBuilder append boolean & null

2024-06-10 Thread Claes Redestad
On Mon, 10 Jun 2024 12:12:58 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 methods c

Re: RFR: 8333854: IllegalAccessError with proxies after JDK-8332457 [v2]

2024-06-10 Thread Claes Redestad
On Mon, 10 Jun 2024 04:08:41 GMT, Chen Liang wrote: >> Please review this patch that fixes a critical issue that breaks some Proxy >> usages. >> >> CONSTANT_Class and CONSTANT_MethodType must fail resolution for inaccessible >> package-private types per JVMS 5.4.3.1 and 5.4.3.5, yet such types

Re: RFR: 8333854: IllegalAccessError with proxies after JDK-8332457 [v2]

2024-06-10 Thread Claes Redestad
On Mon, 10 Jun 2024 04:08:41 GMT, Chen Liang wrote: >> Please review this patch that fixes a critical issue that breaks some Proxy >> usages. >> >> CONSTANT_Class and CONSTANT_MethodType must fail resolution for inaccessible >> package-private types per JVMS 5.4.3.1 and 5.4.3.5, yet such types

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator [v2]

2024-06-10 Thread Claes Redestad
On Fri, 7 Jun 2024 18:58:36 GMT, Claes Redestad wrote: >> This PR refactors type matching in BootstrapMethodInvoker and adds a few >> types, seeking to improve bootstrap overheads of some ConstantBootstraps and >> in particular the ProxyGenerator condys generated f

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator [v3]

2024-06-10 Thread Claes Redestad
e ErrorTest Error Unit > Change > ProxyGenBench.generateAndProxy100 10 26,827 ± 8,954 26,855 ± 7,531 ms/op > 1,00x (p = 0,991 ) > * = significant Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Copy-past

Integrated: 8333824: Unused ClassValue in VarHandles

2024-06-10 Thread Claes Redestad
On Mon, 10 Jun 2024 08:30:59 GMT, Claes Redestad wrote: > Trivially removing the a leftover, unused `ClassValue` from > `java.lang.invoke.VarHandle` This pull request has now been integrated. Changeset: 7b43a8cd Author: Claes Redestad URL: https://git.openjdk.org/jdk/

Re: RFR: 8333824: Unused ClassValue in VarHandles

2024-06-10 Thread Claes Redestad
On Mon, 10 Jun 2024 08:57:23 GMT, Maurizio Cimadamore wrote: > Good catch! Thanks! - PR Comment: https://git.openjdk.org/jdk/pull/19620#issuecomment-2157910277

RFR: 8333824: Unused ClassValue in VarHandles

2024-06-10 Thread Claes Redestad
Trivially removing the a leftover, unused `ClassValue` from `java.lang.invoke.VarHandle` - Commit messages: - 8333824: Unused ClassValue in VarHandles Changes: https://git.openjdk.org/jdk/pull/19620/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19620&range=00 Issue: ht

Re: RFR: 8333833: Remove the use of ByteArrayLittleEndian from UUID::toString [v7]

2024-06-10 Thread Claes Redestad
ter. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > Update src/java.base/share/classes/jdk/internal/util/HexDigits.java > > Co-authored-by: Claes Redestad Great, go ahead and /integrate again and I&

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator [v2]

2024-06-10 Thread Claes Redestad
On Fri, 7 Jun 2024 18:58:36 GMT, Claes Redestad wrote: >> This PR refactors type matching in BootstrapMethodInvoker and adds a few >> types, seeking to improve bootstrap overheads of some ConstantBootstraps and >> in particular the ProxyGenerator condys generated f

Re: RFR: 8333833: UUID toString removes the use of ByteArrayLittleEndian [v7]

2024-06-10 Thread Claes Redestad
ter. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > Update src/java.base/share/classes/jdk/internal/util/HexDigits.java > > Co-authored-by: Claes Redestad Thanks. I hate to nitpick, but is it

Re: RFR: 8333833: UUID toString removes the use of ByteArrayLittleEndian [v6]

2024-06-10 Thread Claes Redestad
On Sun, 9 Jun 2024 22:45:26 GMT, Shaojin Wen wrote: >> After PR #16245, C2 optimizes stores into primitive arrays by combining >> values ​​into larger stores. In the UUID.toString method, >> ByteArrayLittleEndian can be removed, making the code more elegant and >> faster. > > Shaojin Wen has u

Re: RFR: 8333833: UUID toString removes the use of ByteArrayLittleEndian [v5]

2024-06-09 Thread Claes Redestad
On Sun, 9 Jun 2024 07:22:39 GMT, Shaojin Wen wrote: >> After PR #16245, C2 optimizes stores into primitive arrays by combining >> values ​​into larger stores. In the UUID.toString method, >> ByteArrayLittleEndian can be removed, making the code more elegant and >> faster. > > Shaojin Wen has u

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator [v2]

2024-06-08 Thread Claes Redestad
On Fri, 7 Jun 2024 19:22:43 GMT, Chen Liang wrote: >> It's not the intent of this PR to exhaustively enumerate all methods in >> `ConstantBootstraps`, primarily those shown to be bootstrap sensitive in >> some app. I've so far never seen a use of `primitiveClass` (and I admit >> being ignorant

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator

2024-06-07 Thread Claes Redestad
On Fri, 7 Jun 2024 13:46:22 GMT, Jorn Vernee wrote: > As an aside: I suppose we pre-generate all the linkers that get spun up for > these `invokeExact`calls already. But, we might still get a little bit of > mileage out of switching to `invokeBasic`, which bypasses the linkers > altogether. Wi

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator [v2]

2024-06-07 Thread Claes Redestad
e ErrorTest Error Unit > Change > ProxyGenBench.generateAndProxy100 10 26,827 ± 8,954 26,855 ± 7,531 ms/op > 1,00x (p = 0,991 ) > * = significant Claes Redestad has updated the pull request incrementally with one additional commit since the last revi

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator

2024-06-07 Thread Claes Redestad
On Fri, 7 Jun 2024 18:38:52 GMT, ExE Boss wrote: >> src/java.base/share/classes/java/lang/invoke/BootstrapMethodInvoker.java >> line 289: >> >>> 287: * bootstrap method. >>> 288: */ >>> 289: private static final MethodType CONDY_GET_STATIC_FINAL_MT = >>> MethodType.methodType(Obj

Re: RFR: 8333774: Avoid eagerly loading various EmptySpliterator classes [v3]

2024-06-07 Thread Claes Redestad
On Fri, 7 Jun 2024 13:08:24 GMT, Claes Redestad wrote: >> Trivially move a few private static finals to their respective source type >> to avoid eagerly loading a few small classes. > > Claes Redestad has updated the pull request incrementally with one additional >

Integrated: 8333774: Avoid eagerly loading various EmptySpliterator classes

2024-06-07 Thread Claes Redestad
On Fri, 7 Jun 2024 08:21:58 GMT, Claes Redestad wrote: > Trivially move a few private static finals to their respective source type to > avoid eagerly loading a few small classes. This pull request has now been integrated. Changeset: d744059b Author: Claes Redestad URL:

Re: RFR: 8333749: Consolidate ConstantDesc conversion in java.base [v6]

2024-06-07 Thread Claes Redestad
On Fri, 7 Jun 2024 13:56:24 GMT, Chen Liang wrote: >> In java.base, especially in bytecode generators, we have many different >> methods converting known valid Class and MethodType into ClassDesc and >> MethodTypeDesc. These conversions should be consolidated into the same >> utility method fo

Re: RFR: 8333774: Avoid eagerly loading various EmptySpliterator classes [v3]

2024-06-07 Thread Claes Redestad
> Trivially move a few private static finals to their respective source type to > avoid eagerly loading a few small classes. Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/jav

Re: RFR: 8333774: Avoid eagerly loading various EmptySpliterator classes [v2]

2024-06-07 Thread Claes Redestad
> Trivially move a few private static finals to their respective source type to > avoid eagerly loading a few small classes. Claes Redestad has updated the pull request incrementally with two additional commits since the last revision: - revert typo - Copyright - C

RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator

2024-06-07 Thread Claes Redestad
This PR refactors type matching in BootstrapMethodInvoker and adds a few types, seeking to improve bootstrap overheads of some ConstantBootstraps and in particular the ProxyGenerator condys generated for e.g. annotation proxies since [JDK-8332457](https://bugs.openjdk.org/browse/JDK-8332457) I'

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-07 Thread Claes Redestad
On Wed, 5 Jun 2024 13:45:46 GMT, Per Minborg wrote: >> As a note, If we would have access to the contemplated `StableValue` and >> `hash` was declared even as an _instance variable_ `StableValue` in >> a regular class, then it would be trusted and would be eligible for constant >> folding due

Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

2024-06-07 Thread Claes Redestad
On Wed, 5 Jun 2024 12:39:13 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> An assortment of potential improvements >> >> Co-authored-by: Claes Redestad

RFR: 8333774: Avoid eagerly loading various EmptySpliterator classes

2024-06-07 Thread Claes Redestad
Trivially move a few private static finals to their respective source type to avoid eagerly loading a few small classes. - Commit messages: - 8333774: Avoid eagerly loading various EmptySpliterator classes Changes: https://git.openjdk.org/jdk/pull/19591/files Webrev: https://webr

Re: RFR: 8333749: Consolidate ConstantDesc conversion in java.base [v3]

2024-06-07 Thread Claes Redestad
On Thu, 6 Jun 2024 19:12:35 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 469: >> >>> 467: // o instanceof Wrapped(float) >>> 468: cb.aload(SELECTOR_OBJ); >>> 469:

Re: RFR: 8333749: Consolidate ConstantDesc conversion in java.base

2024-06-06 Thread Claes Redestad
On Thu, 6 Jun 2024 18:35:01 GMT, Chen Liang wrote: > In java.base, especially in bytecode generators, we have many different > methods converting known valid Class and MethodType into ClassDesc and > MethodTypeDesc. These conversions should be consolidated into the same > utility method for th

Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

2024-06-05 Thread Claes Redestad
t; commit since the last revision: > > An assortment of potential improvements > > Co-authored-by: Claes Redestad Looks good. Generation of proxy classes gets a nice boost this way. The condy bsm calls that may happen later takes a small hit which we can improve in a fol

Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v14]

2024-06-03 Thread Claes Redestad
On Mon, 3 Jun 2024 11:09:31 GMT, Adam Sotona wrote: >> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use >> classfile API for reflection proxy-generation. Actual implementation of >> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap >> regressi

Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v13]

2024-06-03 Thread Claes Redestad
On Mon, 3 Jun 2024 10:11:34 GMT, Adam Sotona wrote: >> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use >> classfile API for reflection proxy-generation. Actual implementation of >> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap >> regressi

Re: RFR: 8333265: De-duplicate method references in java.util.stream.FindOps

2024-05-30 Thread Claes Redestad
On Thu, 30 May 2024 12:50:36 GMT, Claes Redestad wrote: > Extracting duplicate method references to static field reduce proxy class > spinning and loading. In this case 2 less classes loaded when using > `findAny()` on each type of stream. Vicente filed a bug on javac to investi

Re: RFR: 8333265: De-duplicate method references in java.util.stream.FindOps

2024-05-30 Thread Claes Redestad
On Thu, 30 May 2024 13:04:46 GMT, Chen Liang wrote: > Should we extract them to private static utility methods for potential > laziness support in the future? Ideally we shouldn't have to do any of this. I thought such method references were already de-duplicated in javac - at least within the

RFR: 8333265: De-duplicate method references in java.util.stream.FindOps

2024-05-30 Thread Claes Redestad
Extracting duplicate method references to static field reduce proxy class spinning and loading. In this case 2 less classes loaded when using `findAny()` on each type of stream. - Commit messages: - De-duplicate identical lambdas in FindOps Changes: https://git.openjdk.org/jdk/pul

Re: RFR: 8333103: Re-examine the console provider loading

2024-05-30 Thread Claes Redestad
On Thu, 30 May 2024 10:02:25 GMT, Alan Bateman wrote: > Would it be possible to provide more context/background here? This is not > code that is used during startup. Is there benchmark data to share for first > use of java.io.IO ? I think this was brought to the fore by https://openjdk.org/jep

Re: RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v2]

2024-05-30 Thread Claes Redestad
On Wed, 29 May 2024 09:18:51 GMT, Pavel Rappo wrote: >> The non-constant test was added because that very bailout caused a crash. >> The other test is actually less interesting since it'll likely be covered >> indirectly by regular use. But as we are hiding these away this gets ever >> more ob

Re: RFR: 8333103: Re-examine the console provider loading

2024-05-30 Thread Claes Redestad
On Wed, 29 May 2024 22:25:09 GMT, Naoto Sato wrote: >> Yes, `break` guarantees that the search completes one way or another once >> the module name has been matched. This is not how it used to be done. > > Right. Since `findAny` is after the module name matching, there is at most 1 > match. In

Re: RFR: 8333103: Re-examine the console provider loading

2024-05-29 Thread Claes Redestad
On Wed, 29 May 2024 19:51:36 GMT, Naoto Sato wrote: > There is an initialization code in `Console` class that searches for the > Console implementations. Refactoring the init code not to use lambda/stream > would reduce the (initial) number of loaded classes by about 100 for > java.base implem

Re: RFR: 8332457: Examine startup overheads from JDK-8294961 [v12]

2024-05-29 Thread Claes Redestad
On Wed, 29 May 2024 07:17:38 GMT, Adam Sotona wrote: >> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use >> classfile API for reflection proxy-generation. Actual implementation of >> `ProxyGenerator` is focused on performance, however it causes JDK bootstrap >> regress

Re: RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v2]

2024-05-29 Thread Claes Redestad
On Mon, 27 May 2024 20:55:29 GMT, Pavel Rappo wrote: >> Please review this PR, which supersedes a now withdrawn >> https://github.com/openjdk/jdk/pull/14831. >> >> This PR replaces `ArraysSupport.vectorizedHashCode` with a set of more >> user-friendly methods. Here's a summary: >> >> - Made t

Re: RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v2]

2024-05-29 Thread Claes Redestad
On Wed, 29 May 2024 03:16:02 GMT, Chen Liang wrote: >> In fact, if I change it to `2`, the following tests will fail: >> >> - `jdk/jdk/classfile/Utf8EntryTest.java` >> - `jdk/java/util/zip/ZipCoding.java` >> - `jdk/java/text/Format/MessageFormat/MessageRegression.java` > > Indeed, the actu

Re: RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v2]

2024-05-28 Thread Claes Redestad
On Tue, 28 May 2024 19:13:30 GMT, Jorn Vernee wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix incorrect utf16 hashCode adaptation > > src/java.base/share/classes/jdk/internal/util/ArraysSupport.java line 275: >

Re: RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v2]

2024-05-28 Thread Claes Redestad
On Tue, 28 May 2024 19:19:51 GMT, Jorn Vernee wrote: >> Pavel Rappo has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix incorrect utf16 hashCode adaptation > > test/hotspot/jtreg/compiler/intrinsics/TestArraysHashCode.java line 88: > >>

Re: RFR: 8331291: java.lang.classfile.Attributes class performs a lot of static initializations [v10]

2024-05-24 Thread Claes Redestad
On Fri, 24 May 2024 08:24:15 GMT, Adam Sotona wrote: >> Hi, >> During performance optimization work on Class-File API as JDK lambda >> generator we found some static initialization killers. >> One of them is `java.lang.classfile.Attributes` with tens of static fields >> initialized with individ

Integrated: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations

2024-05-23 Thread Claes Redestad
On Mon, 20 May 2024 10:52:27 GMT, Claes Redestad wrote: > We can fold the call to `Objects.checkIndex` into the code generated in > generateTypeSwitchSkeleton instead of doing so by filtering the MH argument. > This loads 9 less classes (of which 8 generated LFs and Species clas

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations [v4]

2024-05-23 Thread Claes Redestad
On Thu, 23 May 2024 11:09:14 GMT, Claes Redestad wrote: >> We can fold the call to `Objects.checkIndex` into the code generated in >> generateTypeSwitchSkeleton instead of doing so by filtering the MH argument. >> This loads 9 less classes (of which 8 generated LFs and S

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations [v3]

2024-05-23 Thread Claes Redestad
On Thu, 23 May 2024 09:46:51 GMT, Jan Lahoda wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add type switch to HelloClasslist > > src/java.base/share/classes/java/lang/runtime

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations [v4]

2024-05-23 Thread Claes Redestad
used `findStatic` > calls to a holder. All in all this means a reduction by 22M cycles to > bootstrap a trivial switch expression on my M1. Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Remove unused im

Re: RFR: 8332490: JMH org.openjdk.bench.java.util.zip.InflaterInputStreams.inflaterInputStreamRead OOM [v2]

2024-05-22 Thread Claes Redestad
On Wed, 22 May 2024 07:49:27 GMT, Jaikiran Pai wrote: >> Can I please get a review of this test-only change for addressing >> https://bugs.openjdk.org/browse/JDK-8332490? >> >> The jmh test opens a `InflaterInputStream`, reads the stream contents, but >> then doesn't close the stream. This can

Re: RFR: 8332490: JMH org.openjdk.bench.java.util.zip.InflaterInputStreams.inflaterInputStreamRead OOM

2024-05-22 Thread Claes Redestad
On Wed, 22 May 2024 07:20:04 GMT, Alan Bateman wrote: >> Can I please get a review of this test-only change for addressing >> https://bugs.openjdk.org/browse/JDK-8332490? >> >> The jmh test opens a `InflaterInputStream`, reads the stream contents, but >> then doesn't close the stream. This can

Re: RFR: 8332490: JMH org.openjdk.bench.java.util.zip.InflaterInputStreams.inflaterInputStreamRead OOM

2024-05-22 Thread Claes Redestad
On Wed, 22 May 2024 05:16:42 GMT, Jaikiran Pai wrote: > Can I please get a review of this test-only change for addressing > https://bugs.openjdk.org/browse/JDK-8332490? > > The jmh test opens a `InflaterInputStream`, reads the stream contents, but > then doesn't close the stream. This can lead

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations [v3]

2024-05-21 Thread Claes Redestad
On Tue, 21 May 2024 09:01:32 GMT, Claes Redestad wrote: >> We can fold the call to `Objects.checkIndex` into the code generated in >> generateTypeSwitchSkeleton instead of doing so by filtering the MH argument. >> This loads 9 less classes (of which 8 generated LFs and S

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations [v3]

2024-05-21 Thread Claes Redestad
On Tue, 21 May 2024 09:01:32 GMT, Claes Redestad wrote: >> We can fold the call to `Objects.checkIndex` into the code generated in >> generateTypeSwitchSkeleton instead of doing so by filtering the MH argument. >> This loads 9 less classes (of which 8 generated LFs and S

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations [v3]

2024-05-21 Thread Claes Redestad
used `findStatic` > calls to a holder. All in all this means a reduction by 22M cycles to > bootstrap a trivial switch expression on my M1. Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Add type switch to HelloClas

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations [v2]

2024-05-21 Thread Claes Redestad
used `findStatic` > calls to a holder. All in all this means a reduction by 22M cycles to > bootstrap a trivial switch expression on my M1. Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Revert bf68b1d, tidy up ---

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations

2024-05-21 Thread Claes Redestad
On Tue, 21 May 2024 00:16:51 GMT, Chen Liang wrote: >> We can fold the call to `Objects.checkIndex` into the code generated in >> generateTypeSwitchSkeleton instead of doing so by filtering the MH argument. >> This loads 9 less classes (of which 8 generated LFs and Species classes) on >> a min

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations

2024-05-20 Thread Claes Redestad
On Mon, 20 May 2024 18:06:32 GMT, Chen Liang wrote: >> We can fold the call to `Objects.checkIndex` into the code generated in >> generateTypeSwitchSkeleton instead of doing so by filtering the MH argument. >> This loads 9 less classes (of which 8 generated LFs and Species classes) on >> a min

Re: RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations

2024-05-20 Thread Claes Redestad
On Mon, 20 May 2024 10:52:27 GMT, Claes Redestad wrote: > We can fold the call to `Objects.checkIndex` into the code generated in > generateTypeSwitchSkeleton instead of doing so by filtering the MH argument. > This loads 9 less classes (of which 8 generated LFs and Species clas

RFR: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations

2024-05-20 Thread Claes Redestad
We can fold the call to `Objects.checkIndex` into the code generated in generateTypeSwitchSkeleton instead of doing so by filtering the MH argument. This loads 9 less classes (of which 8 generated LFs and Species classes) on a minimal test, while being neutral on a throughput sanity test: Name

Integrated: 8331724: Refactor j.l.constant implementation to internal package

2024-05-17 Thread Claes Redestad
On Mon, 6 May 2024 14:39:08 GMT, Claes Redestad wrote: > This PR suggests refactoring the implementation classes of java.lang.constant > into a new package jdk.internal.constant to enable sharing some trusted > static factory methods with users elsewhere in java.base

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v13]

2024-05-17 Thread Claes Redestad
On Wed, 15 May 2024 11:17:42 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v13]

2024-05-15 Thread Claes Redestad
On Wed, 15 May 2024 11:17:42 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v13]

2024-05-15 Thread Claes Redestad
Change > ClassDescFactories.ReferenceOnly.ofNested 6 209,853 ± 132,525 22,017 ± > 0,573 ns/op 9,53x (p = 0,000*) > * = significant > > > The optimizations could be split out and PRd independently, but I think they > are simple enough to include in this refactoring. Claes Redest

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v12]

2024-05-15 Thread Claes Redestad
Change > ClassDescFactories.ReferenceOnly.ofNested 6 209,853 ± 132,525 22,017 ± > 0,573 ns/op 9,53x (p = 0,000*) > * = significant > > > The optimizations could be split out and PRd independently, but I think they > are simple enough to include in this refactoring. Claes Redesta

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v10]

2024-05-15 Thread Claes Redestad
On Wed, 15 May 2024 09:51:13 GMT, Adam Sotona wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use sb.repeat, consolidate > > src/java.base/share/classes/java/lang/constant/Clas

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v11]

2024-05-15 Thread Claes Redestad
Change > ClassDescFactories.ReferenceOnly.ofNested 6 209,853 ± 132,525 22,017 ± > 0,573 ns/op 9,53x (p = 0,000*) > * = significant > > > The optimizations could be split out and PRd independently, but I think they > are simple enough to include in this refactoring. Claes Rede

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v10]

2024-05-15 Thread Claes Redestad
Change > ClassDescFactories.ReferenceOnly.ofNested 6 209,853 ± 132,525 22,017 ± > 0,573 ns/op 9,53x (p = 0,000*) > * = significant > > > The optimizations could be split out and PRd independently, but I think they > are simple enough to include in this refactoring. Cl

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v9]

2024-05-15 Thread Claes Redestad
On Tue, 14 May 2024 20:20:59 GMT, Chen Liang wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add microbenchmark for ClassDesc methods + a few optimizations > > src/java.base/sh

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v9]

2024-05-14 Thread Claes Redestad
On Tue, 14 May 2024 17:25:37 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v9]

2024-05-14 Thread Claes Redestad
Change > ClassDescFactories.ReferenceOnly.ofNested 6 209,853 ± 132,525 22,017 ± > 0,573 ns/op 9,53x (p = 0,000*) > * = significant > > > The optimizations could be split out and PRd independently, but I think they > are simple enough to include in this refactoring. Claes Re

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v8]

2024-05-14 Thread Claes Redestad
Change > ClassDescFactories.ReferenceOnly.ofNested 6 209,853 ± 132,525 22,017 ± > 0,573 ns/op 9,53x (p = 0,000*) > * = significant > > > The optimizations could be split out and PRd independently, but I think they > are simple enough to include in this refactoring. Claes

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v7]

2024-05-14 Thread Claes Redestad
On Fri, 10 May 2024 08:50:07 GMT, Claes Redestad wrote: >> This PR suggests refactoring the implementation classes of >> java.lang.constant into a new package jdk.internal.constant to enable >> sharing some trusted static factory methods with users elsewhere in >

Re: RFR: 8331291: java.lang.classfile.Attributes class performs a lot of static initializations [v8]

2024-05-14 Thread Claes Redestad
On Mon, 6 May 2024 18:24:25 GMT, Adam Sotona wrote: >> Hi, >> During performance optimization work on Class-File API as JDK lambda >> generator we found some static initialization killers. >> One of them is `java.lang.classfile.Attributes` with tens of static fields >> initialized with individu

Re: RFR: 8327499: MethodHandleStatics.traceLambdaForm includes methods that cannot be generated [v2]

2024-05-10 Thread Claes Redestad
On Fri, 10 May 2024 04:55:21 GMT, Chen Liang wrote: >> GenerateJLIClassesHelper has been making wrong assumptions about Invoker's >> LambdaForm method type parameters. Since they are distinct from those of >> Linkers, they are now tracked and generated separately. It seems that no >> proper in

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v7]

2024-05-10 Thread Claes Redestad
Change > ClassDescFactories.ReferenceOnly.ofNested 6 209,853 ± 132,525 22,017 ± > 0,573 ns/op 9,53x (p = 0,000*) > * = significant > > > The optimizations could be split out and PRd independently, but I think they > are simple enough to include in this refactoring. Claes Redes

Re: RFR: 8331932: Startup regressions in 23-b13 [v5]

2024-05-10 Thread Claes Redestad
On Thu, 9 May 2024 13:34:16 GMT, Claes Redestad wrote: >> A rather large startup regression was introduced in 23-b13 from >> [JDK-8309622](https://bugs.openjdk.org/browse/JDK-8309622). Some of that has >> been dealt with as enhancements such as >> [JDK-8330802](https:/

Integrated: 8331932: Startup regressions in 23-b13

2024-05-10 Thread Claes Redestad
On Wed, 8 May 2024 14:53:05 GMT, Claes Redestad wrote: > A rather large startup regression was introduced in 23-b13 from > [JDK-8309622](https://bugs.openjdk.org/browse/JDK-8309622). Some of that has > been dealt with as enhancements such as > [JDK-8330802](https://bugs.openjdk.or

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v5]

2024-05-10 Thread Claes Redestad
On Thu, 9 May 2024 21:15:31 GMT, Chen Liang wrote: >> A peek into TypeKind during the research for #19105 reveals that TypeKind >> has a few issues: >> 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to >> use "newarray code" >> 2. `fromDescriptor` can throw IOOBE if th

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v4]

2024-05-09 Thread Claes Redestad
On Thu, 9 May 2024 12:29:40 GMT, Adam Sotona wrote: >> I actually am not sure of the reason; it is indeed a tableswitch in >> bytecode. @cl4es might know it better? > > Generally I agree with the API changes and with the > `descriptor.isPrimitive()` test before requesting a descriptor string. >

Re: RFR: 8331932: Startup regressions in 23-b13 [v5]

2024-05-09 Thread Claes Redestad
is particular case > since the amount of added bootstrapping overhead is dependent on which locale > the system runs under, which complicates testing and comparisons due to > relatively large differences in paths taken on different systems. Claes Redestad has updated the pull request

Re: RFR: 8331932: Startup regressions in 23-b13 [v4]

2024-05-08 Thread Claes Redestad
On Wed, 8 May 2024 18:32:42 GMT, Chen Liang wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove redundant constructor > > src/java.base/share/classes/jdk/internal/util/Reference

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v6]

2024-05-08 Thread Claes Redestad
On Wed, 8 May 2024 20:24:52 GMT, Chen Liang wrote: > This patch allows us to merge parsing logic for invoke, constant, and > classfile in the future, all in jdk.internal. Thanks for reviewing! Yes, that's the idea. - PR Comment: https://git.openjdk.org/jdk/pull/19105#issuecomment-

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v5]

2024-05-08 Thread Claes Redestad
On Wed, 8 May 2024 19:06:35 GMT, ExE Boss wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Refactor to further avoid re-validating arguments > > src/java.base/share

Re: RFR: 8331724: Refactor j.l.constant implementation to internal package [v6]

2024-05-08 Thread Claes Redestad
Change > ClassDescFactories.ReferenceOnly.ofNested 6 209,853 ± 132,525 22,017 ± > 0,573 ns/op 9,53x (p = 0,000*) > * = significant > > > The optimizations could be split out and PRd independently, but I think they > are simple enough to include in this refactoring. Claes Redestad

Re: RFR: 8331932: Startup regressions in 23-b13 [v4]

2024-05-08 Thread Claes Redestad
On Wed, 8 May 2024 17:57:22 GMT, Naoto Sato wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove redundant constructor > > src/java.base/share/classes/sun/util/locale/Bas

Re: RFR: 8331932: Startup regressions in 23-b13 [v3]

2024-05-08 Thread Claes Redestad
On Wed, 8 May 2024 17:23:25 GMT, Alan Bateman wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Extract singleton for interning BaseLocale > > src/java.base/share/classes/j

Re: RFR: 8331932: Startup regressions in 23-b13 [v4]

2024-05-08 Thread Claes Redestad
is particular case > since the amount of added bootstrapping overhead is dependent on which locale > the system runs under, which complicates testing and comparisons due to > relatively large differences in paths taken on different systems. Claes Redestad has updated the pull request

<    1   2   3   4   5   6   7   8   9   10   >