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

Ioi Lam iklam at openjdk.org
Thu Oct 3 14:38:40 UTC 2024


On Wed, 2 Oct 2024 23:08:52 GMT, Vladimir Ivanov <vlivanov 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 13 additional commits since the last revision:
>> 
>>  - 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
>>  - 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
>>  - @liach and @cl4es 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
>>  - @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
>>  - ... and 3 more: https://git.openjdk.org/jdk/compare/438ea318...1b067b7b
>
> src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java line 92:
> 
>> 90:         CUSTOMIZE_THRESHOLD = Integer.parseInt(
>> 91:                 props.getProperty("java.lang.invoke.MethodHandle.CUSTOMIZE_THRESHOLD", "127"));
>> 92:         NO_SOFT_CACHE = CDS.disableMethodHandleSoftCache();
> 
> I suggest to use `CDS.disableMethodHandleSoftCache()` as the default and allow to override the mode through a property.
> 
> 
> NO_SOFT_CACHE = Boolean.parseBoolean( 
>         props.getProperty("java.lang.invoke.MethodHandle.NO_SOFT_CACHE", 
>                                         Boolean.toString(CDS.disableMethodHandleSoftCache()));

My initial implementation used a `java.lang.invoke.MethodHandle.NO_SOFT_CACHE` property. However, I was afraid that such a property might be abused, which would cause problems with class unloading. Therefore, I decided to make it fully controlled by HotSpot via a native method.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21049#discussion_r1786336817


More information about the core-libs-dev mailing list