<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>It's perhaps easier to just add an annotation @ForceInlining.</div><div><br data-mce-bogus="1"></div><div>regards,</div><div>RĂ©mi</div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"wenshao" <shaojin.wensj@alibaba-inc.com><br><b>To: </b>"core-libs-dev" <core-libs-dev@openjdk.org><br><b>Sent: </b>Sunday, May 18, 2025 5:51:15 PM<br><b>Subject: </b>C2 inlining failed because the String constructor is too large<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div class="__aliyun_email_body_block"><div style="color: 0070c0;font-size: 14px;font-family: Tahoma, Arial, STHeitiSC-Light, SimSun"><div style="clear: both;"><span>Through JVM Option +PrintInlining, we found that String has a constructor codeSize of 852, which is too large. This caused failed to inline.</span></div><div style="clear: both;"><br></div><div style="clear: both;"><span>The following is the output information of PrintInlining:</span><div style="clear: both;">```</div><div style="clear: both;">                 @ 9   java.lang.String::<init> (12 bytes)   inline (hot)</div><div style="clear: both;">!m                 @ 1   java.nio.charset.Charset::defaultCharset (52 bytes)   inline (hot)</div><div style="clear: both;">!                  @ 8   java.lang.String::<init> (852 bytes)   failed to inline: hot method too big</div><div style="clear: both;">```</div><div style="clear: both;"><br></div><div style="clear: both;">In Java code, the big method that cannot be inlined is the following constructor</div><div style="clear: both;"><br></div><div style="clear: both;">```java</div><div style="clear: both;">String(Charset charset, byte[] bytes, int offset, int length) {}</div><div style="clear: both;">```</div><div style="clear: both;"><br></div></div><div style="clear: both;"><span><span>This is an important method that is called frequently. Breaking it into small methods does not require changing the code logic and is easy to accomplish. </span></span></div><div style="clear: both;"><span><span><br></span></span></div><div style="clear: both;"><span><span>It is the easiest gain with minimal impact. I suggest solving this problem in JDK 25.</span></span></div></div></div><br></blockquote></div></div></body></html>