Re: RFR: 8333893: Optimization for StringBuilder append boolean & null

2024-06-10 Thread Chen Liang
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

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null

2024-06-10 Thread Chen Liang
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

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

2024-06-10 Thread Chen Liang
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

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

2024-06-09 Thread Chen Liang
meter classes. This case isn't covered by existing tests, so a new test > has been added. Chen Liang has updated the pull request incrementally with one additional commit since the last revision: Obtain classloader in security manager friendly code path - Changes: - all: https

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe

2024-06-09 Thread Chen Liang
On Mon, 10 Jun 2024 02:12:11 GMT, Glavo wrote: > Things have changed since https://github.com/openjdk/jdk/pull/14636 was > closed, so let me reopen it. > > https://github.com/openjdk/jdk/pull/15386 confirmed that `VarHandle` in BALE > caused a startup regression. In order to not have any more

RFR: 8333854: IllegalAccessError with proxies after JDK-8332457

2024-06-09 Thread Chen Liang
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 can appear in method descriptors in the same class. The proposed

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

2024-06-09 Thread Chen Liang
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

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

2024-06-09 Thread Chen Liang
On Sat, 8 Jun 2024 23:30:38 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

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

2024-06-08 Thread Chen Liang
On Sat, 8 Jun 2024 15:51:13 GMT, Brett Okken wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add comments > > src/java.base/share/classes/jdk/internal/util/HexDigits.java line 117: > >> 115: >> 116: /** >>

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

2024-06-08 Thread Chen Liang
On Sat, 8 Jun 2024 06:40: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

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

2024-06-08 Thread Chen Liang
On Sat, 8 Jun 2024 06:40: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

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

2024-06-08 Thread Chen Liang
On Sat, 8 Jun 2024 12:25:54 GMT, Sunmisc Unsafe wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add comments > > As far as I know, ByteArrayLittleEndian uses the VarHandle mechanism, which > more efficiently

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

2024-06-08 Thread Chen Liang
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 for e.g. annotation >>

Integrated: 8333749: Consolidate ConstantDesc conversion in java.base

2024-06-08 Thread Chen Liang
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 > ut

Re: RFR: 8327791: UUID toString removes the use of ByteArrayLittleEndian

2024-06-08 Thread Chen Liang
On Sat, 8 Jun 2024 00:19:55 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. I think you mean bug ID

Re: RFR: 8333828: Use value javadoc tag in java.lang.{Float, Double} [v2]

2024-06-07 Thread Chen Liang
On Fri, 7 Jun 2024 22:16:36 GMT, Joe Darcy wrote: >> Use the value tag to make the javadoc for various format-related constants >> more informative to readers. Currently the information is available by >> following the "Constant Field Values" link. >> >> I'll reflow the paragraphs before a

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

2024-06-07 Thread Chen Liang
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

Re: RFR: 8333828: Use value javadoc tag in java.lang.{Float, Double}

2024-06-07 Thread Chen Liang
On Fri, 7 Jun 2024 21:05:33 GMT, Joe Darcy wrote: > Use the value tag to make the javadoc for various format-related constants > more informative to readers. Currently the information is available by > following the "Constant Field Values" link. > > I'll reflow the paragraphs before a push.

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

2024-06-07 Thread Chen Liang
On Fri, 7 Jun 2024 18:47:53 GMT, Claes Redestad wrote: >> Note that [`ConstantBootstraps​::primitiveClass​(Lookup, String, Class)`] >> has a static return type of `Class⁠<⁠?⁠>`, so the following is also needed: >> >> /** >> * Exact type used of the {@link

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

2024-06-07 Thread Chen Liang
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

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

2024-06-07 Thread Chen Liang
> 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 the ease of future maintenance. Ch

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

2024-06-07 Thread Chen Liang
On Fri, 7 Jun 2024 12:12:44 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 for e.g. annotation proxies >

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

2024-06-07 Thread Chen Liang
On Fri, 7 Jun 2024 12:38: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 two additional > commits since the last

Re: RFR: 8333477: Delete extra empty spaces in Makefiles [v2]

2024-06-07 Thread Chen Liang
On Fri, 7 Jun 2024 12:47:39 GMT, Erik Joelsson wrote: >> test/jdk/java/rmi/reliability/benchmark/bench/Makefile line 50: >> >>> 48: clean: >>> 49: rm -f *.class .classes >>> 50: >> >> Hmm, shouldn't this newline at EOF be kept? Asking @ all the people who've >> reviewed this so far,

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

2024-06-07 Thread Chen Liang
> 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 the ease of future maintenance. Ch

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

2024-06-07 Thread Chen Liang
> 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 the ease of future maintenance. Ch

Re: RFR: 8333774: Avoid eagerly loading various EmptySpliterator classes

2024-06-07 Thread Chen Liang
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. Remember to update the copyright year. - Marked as reviewed by liach (Author). PR Review:

Re: RFR: 8333477: Delete extra empty spaces in Makefiles [v2]

2024-06-07 Thread Chen Liang
On Fri, 7 Jun 2024 07:29:39 GMT, SendaoYan wrote: >> Hi all, >> This PR several extra empty spaces and extra empty lines in several >> Makefiles. It's trivial fix, no risk. >> >> Thanks. > > SendaoYan has updated the pull request incrementally with one additional > commit since the last

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

2024-06-06 Thread Chen Liang
On Thu, 6 Jun 2024 19:30:21 GMT, Jorn Vernee wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> mt -> md (desc) > > src/java.base/share/classes/jdk/internal/constant/ConstantUtils.ja

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

2024-06-06 Thread Chen Liang
> 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 the ease of future maintenance. Ch

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

2024-06-06 Thread Chen Liang
On Thu, 6 Jun 2024 19:09:36 GMT, Claes Redestad wrote: > There are some pre-existing places where we call > `ReferenceClassDescImpl.ofValidated` directly that could probably be switched > over to `ConstantUtils.classDesc` for slightly nicer code. Or - if it matters > - add a

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

2024-06-06 Thread Chen Liang
On Thu, 6 Jun 2024 19:01:02 GMT, Claes Redestad wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> mt -> md (desc) > > src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecia

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

2024-06-06 Thread Chen Liang
> 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 the ease of future maintenance. Ch

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

2024-06-06 Thread Chen Liang
On Thu, 6 Jun 2024 18:56:51 GMT, Claes Redestad 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

Re: RFR: 8333377: Migrate Generic Signature parsing to ClassFile API [v2]

2024-06-06 Thread Chen Liang
from CF objects, to reduce compatibility risks. Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits: - Merge branch 'master' of https://github.com/openjdk/jdk into feature/new-generic-info - Remove redundant try-

RFR: 8333749: Consolidate ConstantDesc conversion in java.base

2024-06-06 Thread Chen Liang
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 the ease of future maintenance. - Commit

Re: RFR: 8333477: Delete extra empty spaces in Makefiles

2024-06-06 Thread Chen Liang
On Tue, 4 Jun 2024 07:47:46 GMT, SendaoYan wrote: > Hi all, > This PR several extra empty spaces and extra empty lines in several > Makefiles. It's trivial fix, no risk. > > Thanks. Changes requested by liach (Author). test/jdk/java/rmi/reliability/benchmark/bench/rmi/Makefile line 1: >

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

2024-06-06 Thread Chen Liang
On Thu, 6 Jun 2024 06:41:48 GMT, ExE Boss wrote: >> Sean Gwizdak 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 request contains six additional >> commits

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

2024-06-05 Thread Chen Liang
tional > commit since the last revision: > > Update test/micro/org/openjdk/bench/java/lang/reflect/ProxyGenBench.java > > Co-authored-by: Chen Liang Marked as reviewed by liach (Author). - PR Review: https://git.openjdk.org/jdk/pull/19410#pullrequestreview-2099091898

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

2024-06-05 Thread Chen Liang
On Wed, 5 Jun 2024 12:00:25 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 >>

Re: RFR: 8333477: Delete extra empty spaces in Makefiles

2024-06-04 Thread Chen Liang
On Tue, 4 Jun 2024 07:47:46 GMT, SendaoYan wrote: > Hi all, > This PR several extra empty spaces and extra empty lines in several > Makefiles. It's trivial fix, no risk. > > Thanks. @altrisi As trivial and low-effort as this seems, this is actually fixing some technical debt for legacy

Re: RFR: 8333462: Performance regression of new DecimalFormat() when compare to jdk11

2024-06-04 Thread Chen Liang
On Tue, 4 Jun 2024 02:32:28 GMT, lingjun-cg wrote: > Run the below benchmark test ,it show the average time of new > DecimalFormat() increase 18% when compare to jdk 11. > > the result with jdk 11: > > Benchmark Mode CntScore Error Units >

Re: RFR: 8333396: Performance regression of DecimalFormat.format [v4]

2024-06-04 Thread Chen Liang
On Tue, 4 Jun 2024 09:07:44 GMT, lingjun-cg wrote: >> ### Performance regression of DecimalFormat.format >> From the output of perf, we can see the hottest regions contain atomic >> instructions. But when run with JDK 11, there is no such problem. The >> reason is the removed biased locking.

Re: RFR: 8333396: Performance regression of DecimalFormat.format [v4]

2024-06-04 Thread Chen Liang
On Tue, 4 Jun 2024 09:07:44 GMT, lingjun-cg wrote: >> ### Performance regression of DecimalFormat.format >> From the output of perf, we can see the hottest regions contain atomic >> instructions. But when run with JDK 11, there is no such problem. The >> reason is the removed biased locking.

Re: RFR: 8332547: Unloaded signature classes in DirectMethodHandles [v2]

2024-06-03 Thread Chen Liang
On Mon, 3 Jun 2024 19:36:58 GMT, Vladimir Ivanov wrote: >> JVM routinely installs loader constraints for unloaded signature classes >> when method resolution takes place. MethodHandle resolution took a different >> route and eagerly resolves signature classes instead (see >>

Re: RFR: 8333377: Migrate Generic Signature parsing to ClassFile API

2024-05-31 Thread Chen Liang
On Fri, 17 May 2024 12:01:23 GMT, Chen Liang wrote: > Core reflection's generic signature parsing uses an ancient library with > outdated visitor pattern on a tree model and contains unnecessary > boilerplates. This is a duplication of ClassFile API's signature model. We > shou

Re: RFR: 8333377: Migrate Generic Signature parsing to ClassFile API

2024-05-31 Thread Chen Liang
On Sat, 18 May 2024 05:24:16 GMT, ExE Boss wrote: >> Core reflection's generic signature parsing uses an ancient library with >> outdated visitor pattern on a tree model and contains unnecessary >> boilerplates. This is a duplication of ClassFile API's signature model. We >> should just move

RFR: 8333377: Migrate Generic Signature parsing to ClassFile API

2024-05-31 Thread Chen Liang
Core reflection's generic signature parsing uses an ancient library with outdated visitor pattern on a tree model and contains unnecessary boilerplates. This is a duplication of ClassFile API's signature model. We should just move to ClassFile API, which is more throughoutly tested as well. To

Re: RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor} [v6]

2024-05-31 Thread Chen Liang
On Fri, 31 May 2024 18:39:33 GMT, jengebr wrote: >> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of >> Class[0] instances. This cloning is intended to prevent callers from >> changing array contents, but many Methods have zero exceptions or zero >> parameters, and

Re: RFR: 8332249: Micro-optimize Method.hashCode

2024-05-31 Thread Chen Liang
On Tue, 28 May 2024 17:25:34 GMT, Sean Gwizdak wrote: > Improve the speed of Method.hashCode by caching the hashcode on first use. > I've seen an application where Method.hashCode is a hot path, and this is a > fairly simple speedup. The memory overhead is low. > > This addresses issue >

Re: RFR: 8332249: Micro-optimize Method.hashCode

2024-05-31 Thread Chen Liang
On Wed, 29 May 2024 15:03:15 GMT, Sean Gwizdak wrote: >> src/java.base/share/classes/java/lang/reflect/Method.java line 99: >> >>> 97: private Method root; >>> 98: // Hash code of this object >>> 99: private int hash; >> >> We can declare this field

Re: RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor} [v2]

2024-05-31 Thread Chen Liang
On Fri, 31 May 2024 16:18:01 GMT, jengebr wrote: >> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of >> Class[0] instances. This cloning is intended to prevent callers from >> changing array contents, but smany Methods have zero exceptions or zero >> parameters,

Re: Question on Lambda function

2024-05-31 Thread Chen Liang
> > > > -Zhengyu > > > > > > > > > > > > > > > > > > *From: *Zhengyu Gu > *Date: *Wednesday, May 29, 2024 at 8:28 PM > *To: *Chen Liang > *Cc: *core-libs-dev@openjdk.org > *Subject: *Re: Question on Lambda function > > Hi

Re: RFR: 8333312: Incorrect since tags on new ClassReader and ConstantPool methods

2024-05-31 Thread Chen Liang
On Fri, 31 May 2024 13:04:03 GMT, David M. Lloyd wrote: > The new method additions ClassReader.readEntryOrNull(int, Class) and > ConstantPool.entryByIndex(int, Class) have incorrect since tags; they should > be `@since 23`. Marked as reviewed by liach (Author). - PR Review:

Re: RFR: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull [v6]

2024-05-30 Thread Chen Liang
On Thu, 30 May 2024 19:44:29 GMT, David M. Lloyd wrote: >> Chen Liang 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 request contains 10 addi

Re: RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor}

2024-05-30 Thread Chen Liang
On Wed, 22 May 2024 14:33:31 GMT, Aleksey Shipilev wrote: >> Why can't you do something like this: >> >> return cloneArray ? ReflectionFactory.copyClasses(interfaces) : interfaces; >> >> >> Alternatively, your proposal is a good one too; we can rename this >> `getInterfaces(boolean)` to

Re: RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor}

2024-05-30 Thread Chen Liang
On Wed, 22 May 2024 09:39:50 GMT, Aleksey Shipilev wrote: >> Improve `java/lang/reflect/Method.java` by eliminating needless cloning of >> Class[0] instances. This cloning is intended to prevent callers from >> changing array contents, but smany Methods have zero exceptions or zero >>

Re: RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor}

2024-05-30 Thread Chen Liang
On Wed, 22 May 2024 12:58:40 GMT, jengebr wrote: >> Can't this be used by class cloning interfaces too? > > @liach I see such an opportunity in `Proxy.getProxyConstructor`, is that what > you have in mind? No, I mean here:

Re: RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor}

2024-05-30 Thread Chen Liang
On Wed, 22 May 2024 14:24:40 GMT, jengebr wrote: >> No, I mean here: >> https://github.com/openjdk/jdk/blob/4f1a10f84bcfadef263a0890b6834ccd3d5bb52f/src/java.base/share/classes/java/lang/Class.java#L1329 >> >> (That's also why I suggest putting the utiltiy method in ReflectionFactory >>

Re: RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor}

2024-05-30 Thread Chen Liang
On Tue, 21 May 2024 14:07:29 GMT, jengebr wrote: > Any suggestions? I would recommend a new method `copyClasses`/`copyTypes` in `jdk.internal.reflect.ReflectionFactory`, as it already has related `copyConstructor` and `getExecutableSharedParameterTypes` methods. Also, can you rename your

Re: RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor}

2024-05-30 Thread Chen Liang
On Tue, 21 May 2024 13:49:18 GMT, jengebr wrote: > Improve `java/lang/reflect/Method.java` by eliminating needless cloning of > Class[0] instances. This cloning is intended to prevent callers from > changing array contents, but smany Methods have zero exceptions or zero > parameters, and

Re: RFR: 8330182: Start of release updates for JDK 24 [v9]

2024-05-30 Thread Chen Liang
On Thu, 30 May 2024 16:44:21 GMT, Joe Darcy wrote: >> Get JDK 24 underway. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Update symbol files for JDK 23 build 25.

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

2024-05-30 Thread Chen Liang
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. Marked as reviewed by liach (Author). Indeed,

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

2024-05-30 Thread Chen Liang
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. Should we extract them to private static utility

Integrated: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull

2024-05-30 Thread Chen Liang
On Tue, 21 May 2024 14:33:54 GMT, Chen Liang wrote: > I propose to add type-checked ConstantPool.entryByIndex and > ClassReader.readEntryOrNull taking an extra Class parameter, which throws > ConstantPoolException instead of ClassCastException on type mismatch, which > can happen

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

2024-05-29 Thread Chen Liang
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

Re: Question on Lambda function

2024-05-29 Thread Chen Liang
ed Lambda classes) here to stay, we must come up with a coding > guideline to avoid excessive creation of Lambda classes, any pointers or > suggestions would be greatly appreciated. > > > > Best, > > > > -Zhengyu > > > > *From: *Chen Liang > *Date: *Wednesd

Re: RFR: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull [v6]

2024-05-29 Thread Chen Liang
view from @asotona. Thanks! > > Proposal on mailing list: > https://mail.openjdk.org/pipermail/classfile-api-dev/2024-May/000512.html Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brou

Re: Question on Lambda function

2024-05-29 Thread Chen Liang
/openjdk/jdk/pull/12493 and https://bugs.openjdk.org/browse/JDK-8302154. You are recommended to create your own facility to create hidden classes in Java 17 instead of continue to use LambdaMetafactory explicitly in code. Regards, Chen Liang On Wed, May 29, 2024 at 12:53 PM Zhengyu Gu wrote: > He

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

2024-05-29 Thread Chen Liang
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 >>

Re: RFR: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull [v5]

2024-05-29 Thread Chen Liang
view from @asotona. Thanks! > > Proposal on mailing list: > https://mail.openjdk.org/pipermail/classfile-api-dev/2024-May/000512.html Chen Liang has updated the pull request incrementally with one additional commit since the last revision: Remove redundant import ---

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

2024-05-29 Thread Chen Liang
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

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

2024-05-29 Thread Chen Liang
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 >>

Re: RFR: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull [v4]

2024-05-28 Thread Chen Liang
view from @asotona. Thanks! > > Proposal on mailing list: > https://mail.openjdk.org/pipermail/classfile-api-dev/2024-May/000512.html Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brou

Re: RFR: 8332597: Remove redundant methods from j.l.classfile.ClassReader API [v2]

2024-05-28 Thread Chen Liang
On Fri, 24 May 2024 16:41:33 GMT, Adam Sotona wrote: >> j.l.classfile.ClassReader instance is exposed in the Class-File API through >> j.l.classfile.AttributeMapper::readAttribute method only. >> ClassReader only purpose is to serve as a tool for reading content of a >> custom attribute in a

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

2024-05-28 Thread Chen Liang
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

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

2024-05-28 Thread Chen Liang
On Tue, 28 May 2024 22:20:39 GMT, Pavel Rappo wrote: >> I believe, it should be `1`. Hear me out. In this method, the `length` is >> scaled down, whereas in `StringUTF16` it is not. In this method, it's >> `length`, in `StringUTF16` it's `((byte[]) value).length`. > > In fact, if I change it

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

2024-05-28 Thread Chen Liang
On Tue, 28 May 2024 14:56:35 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 >>

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

2024-05-28 Thread Chen Liang
On Tue, 28 May 2024 11:55:30 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 >>

Re: RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp [v9]

2024-05-28 Thread Chen Liang
On Fri, 24 May 2024 16:17:41 GMT, Adam Sotona wrote: >> ClassFile API `jdk.internal.classfile.verifier.VerifierImpl` performed only >> bytecode-level class verification. >> This patch adds `jdk.internal.classfile.verifier.ParserVerifier` with >> additional class checks inspired by >>

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

2024-05-28 Thread Chen Liang
On Tue, 28 May 2024 11:55:30 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 >>

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

2024-05-27 Thread Chen Liang
On Mon, 27 May 2024 16:08:04 GMT, Adam Sotona wrote: >> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 822: >> >>> 820:.iconst_0() // false >>> 821:.aload(0)// classLoader >>> 822:.invokestatic(CD_Class, "forName", >>>

Re: RFR: 8292955: Collections.checkedMap Map.merge does not properly check key and value [v3]

2024-05-27 Thread Chen Liang
On Thu, 7 Mar 2024 05:33:16 GMT, Lei Zhu wrote: >> When the specified key did not associated with a value, should check the >> `key` and `value` type. > > Lei Zhu has updated the pull request incrementally with one additional commit > since the last revision: > > Use testNG builtin

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

2024-05-27 Thread Chen Liang
On Mon, 27 May 2024 11:47:15 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 >>

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

2024-05-27 Thread Chen Liang
On Mon, 27 May 2024 07:24:47 GMT, Per Minborg wrote: >> This change overrides mutator methods in the implementation returned by >> `Map.of().entrySet()` to throw `UnsupportedOperationException`. > > src/java.base/share/classes/java/util/ImmutableCollections.java line 1323: > >> 1321:

Re: RFR: 8242888: Convert dynamic proxy to hidden classes

2024-05-26 Thread Chen Liang
On Mon, 27 May 2024 00:03:41 GMT, ExE Boss wrote: >> Please review this change that convert dynamic proxies implementations to >> hidden classes, intended to target JDK 24. >> >> Summary: >> 1. Adds new implementation while preserving the old implementation behind >>

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

2024-05-26 Thread Chen Liang
On Fri, 26 Apr 2024 22:27:21 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations

Re: Deterministic naming of subclasses of `java/lang/reflect/Proxy`

2024-05-25 Thread Chen Liang
e (TCS) > <https://www.kth.se/profile/amansha>https://algomaster99.github.io/ > -- > *From:* Chen Liang > *Sent:* Wednesday, May 22, 2024 9:37:16 PM > *To:* Aman Sharma > *Cc:* core-libs-dev@openjdk.org; leyden-...@openjdk.org > *Subject:* Re: Determi

Re: RFR: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull [v3]

2024-05-24 Thread Chen Liang
view from @asotona. Thanks! > > Proposal on mailing list: > https://mail.openjdk.org/pipermail/classfile-api-dev/2024-May/000512.html Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brou

Re: RFR: 8242888: Convert dynamic proxy to hidden classes

2024-05-23 Thread Chen Liang
On Thu, 23 May 2024 03:28:30 GMT, Chen Liang wrote: > Please review this change that convert dynamic proxies implementations to > hidden classes, intended to target JDK 24. > > Summary: > 1. Adds new implementation while preserving the old implem

Re: RFR: 8242888: Convert dynamic proxy to hidden classes

2024-05-23 Thread Chen Liang
On Thu, 23 May 2024 03:28:30 GMT, Chen Liang wrote: > Please review this change that convert dynamic proxies implementations to > hidden classes, intended to target JDK 24. > > Summary: > 1. Adds new implementation while preserving the old implem

Re: RFR: 8242888: Convert dynamic proxy to hidden classes

2024-05-23 Thread Chen Liang
advantage justifies the migration to hidden classes. Chen On Thu, May 23, 2024 at 6:43 AM Remi Forax wrote: > - Original Message - > > From: "Chen Liang" > > To: "core-libs-dev" , "hotspot-dev" < > hotspot-...@openjdk.org>, kulla-...@o

Re: RFR: 8242888: Convert dynamic proxy to hidden classes

2024-05-23 Thread Chen Liang
On Thu, 23 May 2024 03:28:30 GMT, Chen Liang wrote: > Please review this change that convert dynamic proxies implementations to > hidden classes, intended to target JDK 24. > > Summary: > 1. Adds new implementation while preserving the old implem

RFR: 8242888: Convert dynamic proxy to hidden classes

2024-05-22 Thread Chen Liang
Please review this change that convert dynamic proxies implementations to hidden classes, intended to target JDK 24. Summary: 1. Adds new implementation while preserving the old implementation behind `-Djdk.reflect.useLegacyProxyImpl=true` in case there are compatibility issues. 2.

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

2024-05-22 Thread Chen Liang
On Thu, 23 May 2024 00:58:14 GMT, Joe Darcy wrote: > As a general comment, please update all the links to "mandated" so that the > text "implicitly declared" get linked to the MANDATED enum constant. Should we update the API specification for `Parameter::isImplicit`, which checks the

Re: Deterministic naming of subclasses of `java/lang/reflect/Proxy`

2024-05-22 Thread Chen Liang
; > > Regards, > Aman Sharma > > PhD Student > KTH Royal Institute of Technology > School of Electrical Engineering and Computer Science (EECS) > Department of Theoretical Computer Science (TCS) > <http://www.kth.se> <https://www.kth.se/profile/amansha> > <http

Re: RFR: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull [v2]

2024-05-22 Thread Chen Liang
view from @asotona. Thanks! > > Proposal on mailing list: > https://mail.openjdk.org/pipermail/classfile-api-dev/2024-May/000512.html Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brou

Re: GC triggered before VM initialization completed

2024-05-22 Thread Chen Liang
Hi Lorris, This mailing list is for Java's core libraries' development. Your issue is a support request and is not related to Java's core libraries in any way, thus I recommend you look for tech support or create/find an issue at bugs.java.com. Regards, Chen On Wed, May 22, 2024 at 7:16 AM

Re: Deterministic naming of subclasses of `java/lang/reflect/Proxy`

2024-05-22 Thread Chen Liang
gt;> leyden-...@openjdk.org > >> *Subject:* Re: Deterministic naming of subclasses of > >> `java/lang/reflect/Proxy` > >> > >> Hi Aman, > >> For `-verbose:class`, it's a JVM argument instead of a program > argument; > >> so when you run

RFR: 8332614: Type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull

2024-05-21 Thread Chen Liang
I propose to add type-checked ConstantPool.entryByIndex and ClassReader.readEntryOrNull taking an extra Class parameter, which throws ConstantPoolException instead of ClassCastException on type mismatch, which can happen to malformed ClassFiles. Requesting a review from @asotona. Thanks!

  1   2   3   4   5   6   7   8   9   10   >