RFR: 8245756: Reduce bootstrap cost of StringConcatFactory prependers

Claes Redestad claes.redestad at oracle.com
Tue May 26 16:20:36 UTC 2020


On 2020-05-26 00:48, forax at univ-mlv.fr wrote:
>> Not sure in which sense you mean inlining? Few of the methods in the
>> bootstrap code are likely hot enough to see inlining by a JIT - and the
>> resulting MHs should be identical, just not constructed over and over
>> again.
> I'm wondering if the code without the null tests was not simple enough to be inlined by c1,
> the MH creations tends to do a lot of checks that can be removed even by c1.
> 

Time spent in prepender() does not seem to be a significant contributor
to bootstrap overhead - time spent in MHs.insertArguments is, though.

One thing that falls out naturally from this is that prefix can only be
non-null on the first prepender: "foo" + a + "bar" + b ... will bind
both "foo" and "bar" to the a-prepender, then b and subsequent
prependers will never see a prefix constant since it will be bound in
as a suffix of the preceding argument. Thus it makes sense to either
provide a caching mechanism for prependers whose prefix arguments are
pre-bound to null:

http://cr.openjdk.java.net/~redestad/8245756/open.01

We might be able to special-case the first prepender so that we can
remove the prefix argument from prependers in general, which might make
the final MH a bit smaller and easier for the JIT to optimize.

Testing: tier1+2

/Claes


More information about the core-libs-dev mailing list