RFR: 8311071: Avoid SoftReferences in LambdaFormEditor and MethodTypeForm when storing heap objects into AOT cache [v3]

Ioi Lam iklam at openjdk.org
Mon Sep 23 19:03:54 UTC 2024


On Wed, 18 Sep 2024 05:18:13 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
>> 
>>  - @dholmes-ora review comments
>>  - Merge branch 'jep-483-step-05-8293337-archive-method-handle-intrinsics' of /jdk3/yam/open into jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke
>>  - Merge branch 'jep-483-step-05-8293337-archive-method-handle-intrinsics' of /jdk3/yam/open into jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke
>>  - Do not use system property to limit usage to only CDS static dumps
>>  - Merge branch 'jep-483-step-05-8293337-archive-method-handle-intrinsics' of /jdk3/yam/open into jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke
>>  - Merge branch 'jep-483-step-05-8293337-archive-method-handle-intrinsics' of /jdk3/yak/open into jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke
>>  - Merge branch 'jep-483-step-05-8293337-archive-method-handle-intrinsics' of /jdk3/yak/open into jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke
>>  - 8311071: Add an option to avoid using SoftReferences in java.lang.invoke.MethodHandle
>
> src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java line 148:
> 
>> 146:         public LambdaForm get() {
>> 147:             if (cache instanceof LambdaForm) {
>> 148:                 return (LambdaForm)cache;
> 
> Suggestion:
> 
>             if (cache instanceof LambdaForm lf) {
>                 return lf;

Fixed. Thanks for the suggestion.

> src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java line 119:
> 
>> 117:             return null;
>> 118:         } else if (entry instanceof MethodHandle) {
>> 119:             return (MethodHandle) entry;
> 
> Suggestion:
> 
>         } else if (entry instanceof MethodHandle mh) {
>             return mh;

Fixed.

> src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java line 145:
> 
>> 143:             return null;
>> 144:         } else if (entry instanceof LambdaForm) {
>> 145:             return (LambdaForm) entry;
> 
> Suggestion:
> 
>         } else if (entry instanceof LambdaForm lf) {
>             return lf;

Fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21049#discussion_r1771936114
PR Review Comment: https://git.openjdk.org/jdk/pull/21049#discussion_r1771936246
PR Review Comment: https://git.openjdk.org/jdk/pull/21049#discussion_r1771936365


More information about the core-libs-dev mailing list