Re: RFR: 8357289: Break down the String constructor into smaller methods [v3]

2025-05-24 Thread Shaojin Wen
On Sun, 25 May 2025 04:39:24 GMT, Chen Liang wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> create method share variant val & coder > > src/java.base/share/classes/java/lang/String.java line 703: > >> 701:

Re: RFR: 8357289: Break down the String constructor into smaller methods [v5]

2025-05-24 Thread Shaojin Wen
> Through JVM Option +PrintInlining, we found that String has a constructor > codeSize of 852, which is too large. This caused failed to inline. > > The following is the output information of PrintInlining: > > @ 9 java.lang.String:: (12 bytes) inline (hot) > !m

Re: RFR: 8357289: Break down the String constructor into smaller methods [v4]

2025-05-24 Thread Shaojin Wen
> Through JVM Option +PrintInlining, we found that String has a constructor > codeSize of 852, which is too large. This caused failed to inline. > > The following is the output information of PrintInlining: > > @ 9 java.lang.String:: (12 bytes) inline (hot) > !m

Re: RFR: 8357289: Break down the String constructor into smaller methods [v3]

2025-05-24 Thread Chen Liang
On Sun, 25 May 2025 04:47:35 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/String.java line 569: >> >>> 567: } >>> 568: this.value = str.value; >>> 569: this.coder = str.coder; >> >> Suggestion: >> >> this(str); >> >> We have integrated flexi

Re: RFR: 8357289: Break down the String constructor into smaller methods [v3]

2025-05-24 Thread Shaojin Wen
On Sun, 25 May 2025 04:40:44 GMT, Chen Liang wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> create method share variant val & coder > > src/java.base/share/classes/java/lang/String.java line 569: > >> 567:

Re: RFR: 8357289: Break down the String constructor into smaller methods [v3]

2025-05-24 Thread Chen Liang
On Tue, 20 May 2025 02:11:34 GMT, Shaojin Wen wrote: >> Through JVM Option +PrintInlining, we found that String has a constructor >> codeSize of 852, which is too large. This caused failed to inline. >> >> The following is the output information of PrintInlining: >> >> @ 9 ja

Re: RFR: 8357690: Add @Stable and final to java.lang.CharacterDataLatin1 and other CharacterData classes

2025-05-24 Thread Shaojin Wen
On Sat, 24 May 2025 23:04:50 GMT, Chen Liang wrote: >> Classes such as java.lang.CharacterDataXXX have multiple static final >> arrays, which will not be modified. We should add @Stable to provide >> information to the optimizer. > > make/jdk/src/classes/build/tools/generatecharacter/GenerateCh

Re: RFR: 8357690: Add @Stable and final to java.lang.CharacterDataLatin1 and other CharacterData classes

2025-05-24 Thread Chen Liang
On Sat, 24 May 2025 23:40:56 GMT, Shaojin Wen wrote: >> make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java >> line 1195: >> >>> 1193: result.append(" @Stable static final "); >>> 1194: result.append(atype); >>> 1195: result.append(" ").append(

Re: RFR: 8357690: Add @Stable and final to java.lang.CharacterDataLatin1 and other CharacterData classes

2025-05-24 Thread Chen Liang
On Sat, 24 May 2025 10:00:56 GMT, Shaojin Wen wrote: > Classes such as java.lang.CharacterDataXXX have multiple static final arrays, > which will not be modified. We should add @Stable to provide information to > the optimizer. make/jdk/src/classes/build/tools/generatecharacter/GenerateCharact

RFR: 8357690: Add @Stable and final to java.lang.CharacterDataLatin1 and other CharacterData classes

2025-05-24 Thread Shaojin Wen
Classes such as java.lang.CharacterDataXXX have multiple static final arrays, which will not be modified. We should add @Stable to provide information to the optimizer. - Commit messages: - sealed & final - add @Stable - stable Changes: https://git.openjdk.org/jdk/pull/25430/fil

Re: Add @Stable to java.lang.CharacterDataLatin1 and other CharacterData classes

2025-05-24 Thread Chen Liang
Hello Shaojin, I think your proposal is reasonable. These arrays are never mutated. Meanwhile I see some declarations like int A[] in CharacterData00, would be nice if you can convert those declarations to like int[] A too. Regards, Chen From: core-libs-dev on b

Add @Stable to java.lang.CharacterDataLatin1 and other CharacterData classes

2025-05-24 Thread wenshao
Classes such as java.lang.CharacterDataXXX have multiple static final arrays, which will not be modified. We should add @Stable to provide information to the optimizer. such as ```java class CharacterData00 { @Stable static final char[] X = @Stable static final char[] Y = @Stable static final int

Integrated: 8357081: Removed unused methods of HexDigits

2025-05-24 Thread Shaojin Wen
On Thu, 15 May 2025 22:03:22 GMT, Shaojin Wen wrote: > In HexDigits, getCharsLatin1 and getCharsUTF16 are no longer used, so remove > these methods This pull request has now been integrated. Changeset: b0373537 Author:Shaojin Wen URL: https://git.openjdk.org/jdk/commit/b037353734fd

Re: RFR: 8357146: ForkJoinPool:schedule(*) does not throw RejectedExecutionException when pool is shutdown

2025-05-24 Thread Alan Bateman
On Sat, 24 May 2025 11:35:33 GMT, Doug Lea wrote: > Method startDelayScheduler should trap the ISE thrown by > SharedThreadContainer.start and possibly re-try termination before eventually > throwing RejectedExecutionException. src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java

Re: RFR: 8357685: Change the type of Integer::digits from char[] to byte[] [v2]

2025-05-24 Thread Chen Liang
On Sat, 24 May 2025 07:19:24 GMT, Shaojin Wen wrote: >> Integer::digits type can use byte[] instead of char[], which can reduce the >> conversion from char to byte in the process of Integer.toString. Using >> byte[] can also save memory. > > Shaojin Wen has updated the pull request incrementall

Integrated: 8357644: Add missing CPE statements

2025-05-24 Thread Sorna Sarathi N
On Fri, 23 May 2025 11:40:24 GMT, Sorna Sarathi N wrote: > Adds missing classpath exception in a couple of files. This pull request has now been integrated. Changeset: 1f24a541 Author:Sorna Sarathi N Committer: Alexey Semenyuk URL: https://git.openjdk.org/jdk/commit/1f24a5414d735f9

RFC: 8357183: Improving efficiency of Writer::append(CharSequence) and Writer::append(CharSequence, int, int) / Sub Task of 8356679: Using CharSequence::getChars internally

2025-05-24 Thread Markus KARG
Chen, thank you for your approval for a DRAFT PR. Following your proposal, I have published a DRAFT PR at https://github.com/openjdk/jdk/pull/25432 so everybody can see what the actual intended code change looks like, and better focus on that actual code change and its risks and benefits. T

Re: RFR: 8357644: Add missing CPE statements

2025-05-24 Thread duke
On Fri, 23 May 2025 11:40:24 GMT, Sorna Sarathi N wrote: > Adds missing classpath exception in a couple of files. @Sorna-Sarathi Your change (at version 1778c756b997c47938fff1bf15bb8c6b5b855af5) is now ready to be sponsored by a Committer. - PR Comment: https://git.openjdk.org/jd

Re: RFR: 8357685: Change the type of Integer::digits from char[] to byte[] [v2]

2025-05-24 Thread Raffaello Giulietti
On Sat, 24 May 2025 07:19:24 GMT, Shaojin Wen wrote: >> Integer::digits type can use byte[] instead of char[], which can reduce the >> conversion from char to byte in the process of Integer.toString. Using >> byte[] can also save memory. > > Shaojin Wen has updated the pull request incrementall

RFR: 8357146: ForkJoinPool:schedule(*) does not throw RejectedExecutionException when pool is shutdown

2025-05-24 Thread Doug Lea
Method startDelayScheduler should trap the ISE thrown by SharedThreadContainer.start and possibly re-try termination before eventually throwing RejectedExecutionException. - Commit messages: - undo wrong origin - Handle IllegalStateException from SharedThreadContainer.start - Rev

Re: RFR: 8357685: Change the type of Integer::digits from char[] to byte[] [v2]

2025-05-24 Thread Raffaello Giulietti
On Sat, 24 May 2025 07:19:24 GMT, Shaojin Wen wrote: >> Integer::digits type can use byte[] instead of char[], which can reduce the >> conversion from char to byte in the process of Integer.toString. Using >> byte[] can also save memory. > > Shaojin Wen has updated the pull request incrementall

Re: Finding max or min of exactly two objects

2025-05-24 Thread Zheka Kozlov
Collections.max(List.of(a, b))? On Tue, May 13, 2025 at 7:12 PM Tagir Valeev wrote: > The alternatives we have now: > BinaryOperator.maxBy(Comparator.naturalOrder()).apply(a, b); > This speaks clearly about the intent (we'd like to get the maximum and we > write 'maxBy') but very wordy. > > Stre

Re: RFR: 8210549: Runtime.exec: in closeDescriptors(), use FD_CLOEXEC instead of close() [v2]

2025-05-24 Thread Thomas Stuefe
> Hi, please consider the following patch. > > This patch replaces the existing close-file-descriptors-logic we follow > before exec'ing a target binary: instead of explicitly closing the file > descriptors, we mark them as CLOEXEC. That simplifies the logic: it gets rid > of the awkward tiptoe

Re: RFR: 8357683: (process) SIGQUIT still blocked after JDK-8234262 with jdk.lang.Process.launchMechanism=FORK or VFORK [v2]

2025-05-24 Thread Thomas Stuefe
> See bug description. We now unblock all signals in both FORK and POSIX_SPAWN > launch modes. This fixes the problem and makes the behavior consistent across > these two modes. > > I left the VFORK mode alone since I believe the signal state is still shared > with the parent. One more reason t

Re: RFR: 8356995: Provide default methods min(T, T) and max(T, T) in Comparator interface [v4]

2025-05-24 Thread Tagir F . Valeev
On Fri, 23 May 2025 18:57:45 GMT, Roger Riggs wrote: >> Tagir F. Valeev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Make min and max generic > > src/java.base/share/classes/java/util/Comparator.java line 206: > >> 204: * @since

Re: RFR: 8356995: Provide default methods min(T, T) and max(T, T) in Comparator interface [v5]

2025-05-24 Thread Tagir F . Valeev
> Implementation of Comparator.min and Comparator.max methods. Preliminary > discussion is in this thread: > https://mail.openjdk.org/pipermail/core-libs-dev/2025-May/145638.html > The specification is mostly composed of Math.min/max and Collections.min/max > specifications. > > The methods are

Re: RFR: 8356995: Provide default methods min(T, T) and max(T, T) in Comparator interface [v4]

2025-05-24 Thread Tagir F . Valeev
On Fri, 23 May 2025 20:37:05 GMT, Andrey Turbanov wrote: >> Tagir F. Valeev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Make min and max generic > > src/java.base/share/classes/java/util/Comparator.java line 200: > >> 198: * @p

Re: RFR: 8357685: Changing the type of Integer::digits from char[] to byte[] [v2]

2025-05-24 Thread Shaojin Wen
> Integer::digits type can use byte[] instead of char[], which can reduce the > conversion from char to byte in the process of Integer.toString. Using byte[] > can also save memory. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: sta

RFR: 8357685: Changing the type of Integer::digits from char[] to byte[]

2025-05-24 Thread Shaojin Wen
Integer::digits type can use byte[] instead of char[], which can reduce the conversion from char to byte in the process of Integer.toString. Using byte[] can also save memory. - Commit messages: - char[] -> byte[] Changes: https://git.openjdk.org/jdk/pull/25426/files Webrev: htt