RFR: 8350462: MethodTypeForm.LF_INTERPRET can cache the MemberName instead

Chen Liang liach at openjdk.org
Sun Apr 6 00:06:48 UTC 2025


On Sat, 5 Apr 2025 14:26:13 GMT, Zihao Lin <duke at openjdk.org> wrote:

> Modify the cache in MethodTypeForm that currently stores the LF_INTERPRET Lambda form. Instead of caching the entire LambdaForm, change it to store a SoftReference<MemberName>. This will avoid unnecessary memory usage.

src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java line 71:

> 69:     // Indexes into lambdaForms:
> 70:     static final int
> 71:             LF_INVVIRTUAL              =  0,  // DMH invokeVirtual

You can remove the LF_INTERPRET constant from this list.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24468#discussion_r2029997791


More information about the core-libs-dev mailing list