RFR: 8351443: Improve robustness of StringBuilder [v9]
Chen Liang
liach at openjdk.org
Sat May 17 17:09:59 UTC 2025
On Sat, 17 May 2025 15:04:21 GMT, Markus KARG <duke at openjdk.org> wrote:
>> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Removed extraneous "the"
>
> src/java.base/share/classes/java/lang/StringUTF16.java line 1535:
>
>> 1533: checkBoundsBeginEnd(i, end, value);
>> 1534: putChar(value, i, c1);
>> 1535: putChar(value, i + 1, c2);
>
> Can someone please shed some light on this change: What is the benefit of `i + constant` over `i++`? 🤔
i++ generates excessive store bytecodes compared to +1, +2, ... and the result bytecode size is larger, which is harmful to jit.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24967#discussion_r2094169027
More information about the core-libs-dev
mailing list