RFR: 8222852: Reduce String concat combinator tree shapes by folding constants into prependers

Claes Redestad claes.redestad at oracle.com
Mon Apr 29 09:34:11 UTC 2019

Hi Peter,

On 2019-04-28 23:34, Claes Redestad wrote:
>>> What do you think?
>> This is what I meant by "simplified wiring logic":
>> http://cr.openjdk.java.net/~plevart/jdk-dev/8222852_StringConcatOpt/webrev.02p/ 
>> I haven't tried this though, but if it works correctly and if JIT 
>> inlines the strategy for each call site, it should also eliminate the 
>> dead code paths that are detected from null/non-null bound constants 
>> and the end result should be equivalent machine code. But that's just 
>> in theory...
> thanks for picking this up and experimenting further with it!

having run the numbers on your patch, I'm warming to this approach:

- It seems the branches testing for null do get eliminated (no
regressions in neither existing nor new micro trying to provoke
pollution between LFs)
- Startup numbers generally a bit better, and the amortized/repeated
bootstrap cost of always binding in prefix and suffix appears to be
- The logic for handling constants is nicer and less spread out; bonus
points for folding successive suffix constants!


I merged some of the cleanups and comments and think this is good to
go rather than splitting it up into a follow-up RFE.



More information about the core-libs-dev mailing list