RFC (S) 8076758: new StringBuilder().append(String).toString() should be recognized by OptimizeStringConcat

Tobias Hartmann tobias.hartmann at oracle.com
Mon Aug 31 05:24:51 UTC 2015

Hi Aleksey,

I don't think you need the has_offset_field() check because the String.offset field was removed long time ago. We're going to remove the legacy VM side code with the compact strings JEP [1].

Otherwise it looks good. Please also execute the following test [2] from compact strings because it contains some string concat correctness checks.


[1] http://hg.openjdk.java.net/jdk9/sandbox/hotspot/rev/2da46f06bfba
[2[ http://hg.openjdk.java.net/jdk9/sandbox/hotspot/file/b50bebd0085b/test/compiler/intrinsics/string/TestStringIntrinsics.java

On 28.08.2015 12:12, Aleksey Shipilev wrote:
> Hi,
> I would like to see this one fixed, because it touches on pending String
> improvements in JDK:
>   https://bugs.openjdk.java.net/browse/JDK-8076758
> Here is a proof-of-concept patch:
>   http://cr.openjdk.java.net/~shade/8076758/webrev.00/
> It passes JPRT and fixes the performance issues in microbenchmarks, but
> I'm not sure the code change is completely correct, given the history of
> OptimizeStringConcat bugs. Could anyone from a compiler team chime in?
> Thanks!
> -Aleksey

More information about the hotspot-compiler-dev mailing list