RFR: 8341696: C2: Non-fluid StringBuilder pattern bails out in OptoStringConcat [v4]
Theo Weidmann
tweidmann at openjdk.org
Wed Jan 8 13:43:43 UTC 2025
On Wed, 8 Jan 2025 13:37:45 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> It's not supposed to be a verb. This methods checks a potential `append` call (a call that might be a call to StringBuilder::append), so it's an *append candidate*. Do you have any suggestions to clarify that?
>
> Hmm... Ok. In my opinion a `check` method should be "pure", so it shoud not really have a side-effect... but you do some
> `sc->add_control(cnode);` and `sc->push_string(arg);` etc.
>
> I'm not familiar enough with the code yet, but those side-effects. Ah, the comment in the hpp seems to suggest you `add` it. So maybe:
> `add_the_append_candidate_to_sc_if_<something>`
> A bit long, but would be more helpful I think
I think then I will just call it `process_append_candidate` then. There's no point in trying to explain the complex logic in the method name. This method together with its callee would better be moved into another class anyhow – but I gave up this idea because of all the codependencies.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22537#discussion_r1907201016
More information about the hotspot-compiler-dev
mailing list