RFR: 8255493: Support for pre-generated java.lang.invoke classes in CDS dynamic archive
Yumin Qi
minqi at openjdk.java.net
Thu Apr 22 21:18:27 UTC 2021
On Thu, 22 Apr 2021 06:03:35 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Hi, Please review
>>
>> When do dynamic dump, the pre-generated lambda form classes from java.lang.invoke are not stored in dynamic archive. The patch will regenerate the four holder classes,
>> "java.lang.invoke.Invokers$Holder",
>> "java.lang.invoke.DirectMethodHandle$Holder",
>> "java.lang.invoke.DelegatingMethodHandle$Holder",
>> "java.lang.invoke.LambdaForm$Holder"
>> which will include the versions in static archive and new loaded functions all together and stored in dynamic archive. New test case added.
>> (Minor change to PrintSharedArchiveAtExit, which the index is not consecutive)
>>
>> Tests: tier1,tier2,tier3,tier4
>>
>> Thanks
>> Yumin
>
> src/hotspot/share/memory/dynamicArchive.cpp line 374:
>
>> 372: if (LambdaFormInvokers::should_regenerate_holder_classes()) {
>> 373: JavaThread* THREAD = JavaThread::current();
>> 374: assert(THREAD->is_Java_thread(), "Should be JavaThread");
>
> JavaThread::current() already asserts this.
Will remove the assert.
I will also move the check should_regenerate_holder_classes to LambdaFormInvokers::should_regenerate_holder_classes().
> src/hotspot/share/memory/dynamicArchive.cpp line 376:
>
>> 374: assert(THREAD->is_Java_thread(), "Should be JavaThread");
>> 375: log_info(cds, dynamic)("Regenerate lambdaform holder classes ...");
>> 376: LambdaFormInvokers::regenerate_holder_classes(THREAD);
>
> What if this throws an exception?
If there is exception in java side to regenerate the holder classes, there is a log for cds to indicate the regeneration failed, the exception is cleared and continue. It will not affect other parts.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3611
More information about the hotspot-dev
mailing list