RFR: 8255493: Support for pre-generated java.lang.invoke classes in CDS dynamic archive [v12]

Ioi Lam iklam at openjdk.java.net
Mon May 3 05:33:13 UTC 2021


On Fri, 30 Apr 2021 15:25:43 GMT, Yumin Qi <minqi 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
>
> Yumin Qi 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 18 additional commits since the last revision:
> 
>  - Removed macro for exception handling, removed checking exception after reload class
>  - Merge branch 'master' of ssh://github.com/yminqi/jdk into jdk-8255493
>  - Changed DynamicArchive::dump as static counterpart. Suppressed exceptions in LambdaFormInvokers::regenerate_holder_classes except for oom
>  - Merge branch 'master' into jdk-8255493
>  - Merge branch 'master' of ssh://github.com/yminqi/jdk into jdk-8255493
>  - Only store four lambda invoker (which will be regenerated in dynamic dump) lines in static archive
>  - Removed TRAP from regenerate_holder_classes, also correct SharedLambdaDictionaryPrinter index
>  - Merge branch 'master' into jdk-8255493
>  - Restore filemap.[ch]pp
>  - Remove unnecessary file header including
>  - ... and 8 more: https://git.openjdk.java.net/jdk/compare/859cafde...95d68855

Changes requested by iklam (Reviewer).

src/hotspot/share/cds/lambdaFormInvokers.cpp line 142:

> 140:     memcpy(buf, (char*)h_bytes->byte_at_addr(0), len);
> 141:     ClassFileStream st((u1*)buf, len, NULL, ClassFileStream::verify);
> 142:     reload_class(class_name, st, THREAD);

`reload_class(class_name, st, THREAD);` should be `reload_class(class_name, st, CHECK);`. If an error happens inside there, it means `CDS.generateLambdaFormHolderClasses()` has generated a bad classfile, or we have hit an OOM. In either case, we should report the error back to the caller.

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

PR: https://git.openjdk.java.net/jdk/pull/3611


More information about the hotspot-dev mailing list