[jdk25u] RFR: 8357289: Break down the String constructor into smaller methods [v2]

Goetz Lindenmaier goetz at openjdk.org
Tue Nov 25 10:41:18 UTC 2025


On Fri, 31 Oct 2025 08:46:44 GMT, Shaojin Wen <swen at openjdk.org> 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.lang.String::<init> (12 bytes)   inline (hot)
>> !m                 @ 1   java.nio.charset.Charset::defaultCharset (52 bytes)   inline (hot)
>> !                  @ 8   java.lang.String::<init> (852 bytes)   failed to inline: hot method too big
>> 
>> 
>> In Java code, the big method that cannot be inlined is the following constructor
>> 
>> 
>> String(Charset charset, byte[] bytes, int offset, int length) {}
>> 
>> The above String constructor is too large; break it down into smaller methods with a codeSize under 325 to allow them to be inlined by the C2.
>
> Shaojin Wen has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   8357289: Break down the String constructor into smaller methods
>   
>   Reviewed-by: liach, rriggs

Hi @wenshao,
your approval request comment should please list: Reason, Risk, Rework needed?, testing.  See also https://wiki.openjdk.org/display/JDKUpdates/How+to+contribute+or+backport+a+fix

-------------

PR Comment: https://git.openjdk.org/jdk25u/pull/351#issuecomment-3574967455


More information about the jdk-updates-dev mailing list