RFR: 8293337: Store method handle intrinsics in AOT cache [v4]

Coleen Phillimore coleenp at openjdk.org
Thu Sep 19 19:28:35 UTC 2024


On Wed, 18 Sep 2024 03:02:19 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> This is the 5th PR for [JEP 483: Ahead-of-Time Class Loading & Linking](https://bugs.openjdk.org/browse/JDK-8315737).
>> 
>> This PR is necessary to support [JDK-8293336: AOT-linking of invokedynamic for lambda expression and string concat](https://bugs.openjdk.org/browse/JDK-8293336), which needs to store Java heap objects that have native pointers to the C++ `Method` objects  returned by `SystemDictionary::find_method_handle_intrinsic()` 
>> 
>> These `Method` objects are created within the JVM. They do not belong to any actual Java classes. We store all these `Method` objects into the AOT cache, so that they can be referenced by other artifacts in the AOT cache.
>> 
>> ---
>> See [here](https://bugs.openjdk.org/browse/JDK-8315737) for the sequence of dependent RFEs for implementing JEP 483.
>
> 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 11 additional commits since the last revision:
> 
>  - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics
>  - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics
>  - @vnkozlov comment - added NOT_CDS_RETURN
>  - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics
>  - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics
>  - some clean up
>  - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics
>  - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics
>  - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics
>  - Merge branch 'jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap' into jep-483-step-05-8293337-archive-method-handle-intrinsics
>  - ... and 1 more: https://git.openjdk.org/jdk/compare/9320bca9...988f101c

I have one question, but this is good.  I've always wanted these to be shared.

src/hotspot/share/classfile/systemDictionary.cpp line 2095:

> 2093:   }
> 2094: }
> 2095: #endif

Can you add // INCLUDE_CDS

This is called at startup time before anything so it doesn't need the locking?

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

PR Review: https://git.openjdk.org/jdk/pull/20959#pullrequestreview-2316570560
PR Review Comment: https://git.openjdk.org/jdk/pull/20959#discussion_r1767488604


More information about the hotspot-dev mailing list