RFR: 8333893: Optimization for StringBuilder append boolean & null [v4]

Claes Redestad redestad at openjdk.org
Wed Jun 12 14:05:16 UTC 2024


On Wed, 12 Jun 2024 13:38:21 GMT, Shaojin Wen <duke at openjdk.org> wrote:

> In the AbstractStringBuilder#appendNull method, is it possible to not check the bounds based on the information from ensureCapacityInternal?

Perhaps you'd need something like a `Preconditions.checkIndex` in or before the 4-char `StringUTF16.putCharsAt` call to help eliminate excess bounds checks. Might work, but would be fragile and probably not easy to get right in all places.

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

PR Comment: https://git.openjdk.org/jdk/pull/19626#issuecomment-2163093085


More information about the hotspot-compiler-dev mailing list