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

2025-05-26 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 [v6]

2025-05-26 Thread Chen Liang
On Mon, 26 May 2025 13:23:07 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: 8357289: Break down the String constructor into smaller methods [v6]

2025-05-26 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-26 Thread Claes Redestad
On Mon, 26 May 2025 12:00:02 GMT, Per Minborg wrote: >> I thought this would both increase cleaniness and reduce code size of the >> decode method. @minborg What do you think? This also removes one of the >> switches on COMPACT_STRING. > > I think it is better to keep the code smaller rather th

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

2025-05-26 Thread Per Minborg
On Sun, 25 May 2025 12:54:03 GMT, Chen Liang wrote: >> private String(char[] value, int off, int len, Void sig) { >> if (len == 0) { >> this.value = "".value; >> this.coder = "".coder; >> return; >> } >> if (COMPACT_STRINGS) { >>

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

2025-05-25 Thread Chen Liang
On Sun, 25 May 2025 06:27:14 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/String.java line 703: >> >>> 701: throw new Error(x); >>> 702: } >>> 703: if (COMPACT_STRINGS) { >> >> Now we can call other constructors of String, so instead o

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: 8357289: Break down the String constructor into smaller methods [v3]

2025-05-20 Thread Shaojin Wen
On Tue, 20 May 2025 08:26:20 GMT, Per Minborg wrote: > I wonder if it would be better to first check `COMPACT_STRINGS` in a > first-level `if` and then branch off to separate support methods? Looking at > the comments near the declaration of `COMPACT_STRINGS`, this might provide > additional b

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

2025-05-20 Thread Per Minborg
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: 8357289: Break down the String constructor into smaller methods [v3]

2025-05-19 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 [v2]

2025-05-19 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

2025-05-19 Thread Chen Liang
On Tue, 20 May 2025 01:21:34 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/String.java line 690: >> >>> 688: .onUnmappableCharacter(CodingErrorAction.REPLACE); >>> 689: char[] ca = new char[en]; >>> 690: int caLen = decodeWithDecoder(cd, ca, byt

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

2025-05-19 Thread Shaojin Wen
On Sun, 18 May 2025 20:44:12 GMT, Chen Liang 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 jav

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

2025-05-19 Thread Chen Liang
On Sun, 18 May 2025 12:48:07 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 java.lan

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

2025-05-19 Thread Shaojin Wen
On Sun, 18 May 2025 12:48:07 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 java.lan

RFR: 8357289: Break down the String constructor into smaller methods

2025-05-19 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 @ 1 java.