Background:
Today we regenerate 4 classes during CDS dumping. See
https://github.com/openjdk/jdk/blob/45eaf5edd806b1f8d5c7d037752766f1737060b9/src/hotspot/share/cds/lambdaFormInvokers.cpp#L57-L61
static const char* filter[NUM_FILTER] = {"java.lang.invoke.Invokers$Holder",
"java.lang.invoke.DirectMethodHandle$Holder",
"java.lang.invoke.DelegatingMethodHandle$Holder",
"java.lang.invoke.LambdaForm$Holder"};
We maintain a table in lambdaFormInvokers.cpp to record the results. When writing the CDS archive, we skip the original versions of these classes and archive the regenerated version.
Requirements:
The handling of regenerated classes need to be refactored to enable future development:
[1] Improve the API to access the regenerated classes and their methods
[2] Allow more classes to be regenerated (not just the Lambda Form invokers)
Details:
In future Leyden-related RFEs, such as JDK-8293336, we will have other data structures that point to the original classes (e.g., MemberNames may point to methods in the original classes). These pointers need to be redirected to the regenerated versions.
Also, in JDK-8288334, we need to reload a new InstanceKlass of each "old" class that has been linked.