RFR: 8342806: Desugar capturing lambda in StringNameTable [v2]

Claes Redestad redestad at openjdk.org
Tue Oct 22 11:56:13 UTC 2024


On Tue, 22 Oct 2024 11:27:53 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/util/StringNameTable.java line 68:
>> 
>>> 66:         if (name == null) {
>>> 67:             name = new NameImpl(this, intern ? string.intern() : string);
>>> 68:             nameMap.put(string, name);
>> 
>> Since we are interning, can we use the possibly-interned result as map key when we put the name? This will be another bug fixed by desugaring.
>
> Nice catch! I don't think we use the interning today since performance was subpar, and this might be a contributing factor. Re-running the micros.

No significant difference on the micros. Theoretically reduces the retained set during a compilation, though, so can't hurt.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21631#discussion_r1810576010


More information about the compiler-dev mailing list