RFR: 8341696: C2: Non-fluid StringBuilder pattern bails out in OptoStringConcat [v5]

Theo Weidmann tweidmann at openjdk.org
Fri Jan 17 08:18:21 UTC 2025


On Thu, 16 Jan 2025 12:44:34 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Theo Weidmann has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Make code more clear
>
> src/hotspot/share/opto/stringopts.cpp line 439:
> 
>> 437:       }
>> 438: #endif
>> 439:       return ProcessAppendResult::AbortOptimization;
> 
> Question: is it a problem that we already did `sc->add_control(cnode);` in this case?

No, since the entire StringConcat instance is thrown away, that is, never used, in this case. It is created in PhaseStringOpts::build_candidate which returns immediately if we return AbortOptimization and doesn't escape.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22537#discussion_r1919719394


More information about the hotspot-compiler-dev mailing list