Simplify toString() implementations in Integer and Long

Roger Riggs roger.riggs at oracle.com
Thu Oct 23 14:03:21 UTC 2025


Looks like a straight-forward cleanup.

Thanks, Roger

On 10/23/25 9:56 AM, wenshao wrote:
> With the introduction of String.newStringWithLatin1Bytes, we can use 
> it to simplify the toString methods of Integer and Long. By replacing 
> the implementation that supports COMPACT_STRING = false with 
> newStringWithLatin1Bytes, we gain the following benefits:
> 1. Simplified implementation
> 2. Strings with codeSize < 35 in Integer.toString(int) and 
> Long.toString(long) can be inlined in C1, improving performance in 
> early calls.
>
> To make it easier to understand my proposal, I created a draft PR and 
> hope to get your feedback. https://github.com/openjdk/jdk/pull/27929
>
>
> -
> Shaojin Wen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20251023/002a708e/attachment.htm>


More information about the core-libs-dev mailing list