JDK-8308463 : Refactor regenerated class handling in lambdaFormInvokers.cpp
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-05-19
  • Updated: 2023-07-12
  • Resolved: 2023-06-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b05Fixed
Related Reports
Relates :  
Description
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.
Comments
Changeset: cf8d7063 Author: Ioi Lam <iklam@openjdk.org> Date: 2023-06-29 04:28:30 +0000 URL: https://git.openjdk.org/jdk/commit/cf8d7063006e29fcf83e88a63fe940eaaf0d12df
29-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14573 Date: 2023-06-21 00:00:06 +0000
21-06-2023