-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8307468: CDS Lambda Proxy classes are regenerated in dynamic dump #15524
8307468: CDS Lambda Proxy classes are regenerated in dynamic dump #15524
Conversation
👋 Welcome back ccheung! A progress list of the required criteria for merging this PR into |
/label add hotspot-runtime |
@calvinccheung |
Webrevs
|
src/hotspot/share/prims/jvm.cpp
Outdated
interface_method_type, m, dynamic_method_type, THREAD); | ||
InstanceKlass* shared_lambda = nullptr; | ||
if (caller_ik->is_shared()) { | ||
shared_lambda = SystemDictionaryShared::get_shared_lambda_proxy_class(caller_ik, interface_method_name, factory_type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of doing a search here, if we first search in InnerClassLambdaMetafactory.spinInnerClass
, we can avoid generating the class when we are dumping the dynamic archive and the lambda proxy class is already present in the static archive.
I think the change proposed by @iklam here is on the same line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the changes in InnerClassLambdaMetafactory.java
and reverted the changes in jvm.cpp
. I also removed the following check in LambdaProxyClassArchive.java
:
if (CDS.isDumpingArchive())
throw new IllegalStateException("cannot load class from CDS archive at dump time");
Will do more testing before posting an update.
@@ -66,7 +66,7 @@ static void test() throws Exception { | |||
"-Xlog:cds=debug", | |||
"-cp", appJar, mainClass, "run") | |||
.assertNormalExit(output -> { | |||
output.shouldContain("Used all archived lambda proxy classes for: UsedAllArchivedLambdasApp run()Ljava/lang/Runnable;") | |||
output.shouldContain("Used all dynamic archived lambda proxy classes for: UsedAllArchivedLambdasApp run()Ljava/lang/Runnable;") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth checking the output for "Used all static archived lambda proxy classes for" as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Used all static archived lambda proxy classes for" log output isn't applicable to the UsedAllArchivedLambdas.java
test because the lambda proxy classes are all in the dynamic archive. It could be applicable to the new test. I'll check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashu-mehra Could you review my updated changes? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
// Generate a class list for static dump. | ||
// Note that the class list contains one less lambda proxy class comparing | ||
// with running the LambdasWithSameKey app with the "run" argument. | ||
String[] launchArgs = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String[] launchArgs = { | |
String[] launchArgs = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@calvinccheung This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 159 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@calvinccheung thanks for addressing the comments. lgtm. |
@ashu-mehra, @turbanoff, @iklam Thanks for the review. /integrate |
Going to push as commit 25e85db.
Your commit was automatically rebased without conflicts. |
@calvinccheung Pushed as commit 25e85db. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this changeset for fixing the following issues:
Also added a test.
Passed tiers 1 - 4 testing.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15524/head:pull/15524
$ git checkout pull/15524
Update a local copy of the PR:
$ git checkout pull/15524
$ git pull https://git.openjdk.org/jdk.git pull/15524/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15524
View PR using the GUI difftool:
$ git pr show -t 15524
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15524.diff
Webrev
Link to Webrev Comment