<i18n dev> RFR: 8365186: Reduce size of j.t.f.DateTimePrintContext::adjust
Shaojin Wen
swen at openjdk.org
Sat Aug 9 05:55:11 UTC 2025
On Fri, 8 Aug 2025 13:42:25 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> By adding the JVM startup parameters `-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining` and analyzing the printed log information, and found that the code size of the j.t.f.DateTimePrintContext::adjust method is 382, which is greater than 325, causing inlining failure.
>>
>>
>> @ 7 java.time.format.DateTimePrintContext::adjust (382 bytes) failed to inline: hot method too big
>>
>>
>> By splitting the code into `common/uncommon`, and moving the uncommon code into adjust0, the adjust method is kept small and can be inlined by the C2 optimizer.
>
> src/java.base/share/classes/java/time/format/DateTimePrintContext.java line 164:
>
>> 162: }
>> 163:
>> 164: private static TemporalAccessor adjust(
>
> Please fold the parameters into fewer (1) lines and briefly document the rationale for the internal method.
If the third adjust method parameter is placed on the same line, the line will have 195 characters (it is generally recommended to be less than 120).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26633#discussion_r2264536335
More information about the i18n-dev
mailing list