RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v2]

ExE Boss duke at openjdk.org
Wed Oct 9 03:59:59 UTC 2024


On Tue, 1 Oct 2024 07:53:23 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/cds/aotConstantPoolResolver.cpp line 476:
>> 
>>> 474:   if (bsm_klass->equals("java/lang/invoke/StringConcatFactory") &&
>>> 475:       bsm_name->equals("makeConcatWithConstants")) {
>>> 476:     return true;
>> 
>> I think all BSM entries in SCF are deterministic, really. So we can just check for the class?
>
> We haven't done much testing with the other SCF BSMs, so I think it's better to do that in a follow-up REF.

`StringConcatFactory​::makeConcat(…)` is definitely deterministic, as it simply delegates to `StringConcatFactory​::makeConcatWithConstants(…)` with the recipe being based on the number of `MethodType` parameters:
https://github.com/openjdk/jdk/blob/de90204b60c408ef258a2d2515ad252de4b23536/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java#L231-L240

And there is no other bootstrap method in `StringConcatFactory` at the moment.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21143#discussion_r1792745509


More information about the core-libs-dev mailing list