-
Enhancement
-
Resolution: Unresolved
-
P4
-
tbd
Before JEP 280, javac compiles string concatenation with StringBuilder.append chain calls, and PhaseStringOpts further optimize such chain calls with limited pattern.
After JEP280, javac compiles string concatenation to invokedynmiac that facilitate the creation of String concatenation by using StringConcatFactory, it covers more patterns.
The use case of PhaseStringOpts become rare, it is only used when the user writes StringBuilder.append.append explicitly, we can consider either
1) Deprecate StringBuilder, encourage to use operator + to concatenate strings.
2) Improve PhaseStringOpts, support more patterns(e.g. no-chain calls, append(float/long/etc))
3) Improve PhaseStringOpts, generate invokedynamic by using StringCocnatFactory to avoid manual IR matching and generation
After JEP280, javac compiles string concatenation to invokedynmiac that facilitate the creation of String concatenation by using StringConcatFactory, it covers more patterns.
The use case of PhaseStringOpts become rare, it is only used when the user writes StringBuilder.append.append explicitly, we can consider either
1) Deprecate StringBuilder, encourage to use operator + to concatenate strings.
2) Improve PhaseStringOpts, support more patterns(e.g. no-chain calls, append(float/long/etc))
3) Improve PhaseStringOpts, generate invokedynamic by using StringCocnatFactory to avoid manual IR matching and generation