Skip to content
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

8257241: CDS should not handle disableEagerInitialization for archived lambda proxy classes #1542

Conversation

calvinccheung
Copy link
Member

@calvinccheung calvinccheung commented Dec 1, 2020

Please review this change which includes:

  • If the jdk.internal.lambda.disableEagerInitializationproperty is enabled, the InnerClassLambdaMetafactory will not involve CDS to archive lambda proxy classes or to find them from an archive.

  • Not passing the initialize (same as !disableEagerInitialization) to LambdaProxyClassArchive.find and eventually to the JVM_LookupLambdaProxyClassFromArchive function.

Testing:

  • all cds/appcds tests locally on linux-x64

  • tiers 1 - 4 (in progress)


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8257241: CDS should not handle disableEagerInitialization for archived lambda proxy classes

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1542/head:pull/1542
$ git checkout pull/1542

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 1, 2020

👋 Welcome back ccheung! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 1, 2020

@calvinccheung The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Dec 1, 2020
@calvinccheung
Copy link
Member Author

/label remove hotspot
/label add hotspot-runtime

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label Dec 1, 2020
@openjdk
Copy link

openjdk bot commented Dec 1, 2020

@calvinccheung
The hotspot label was successfully removed.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Dec 1, 2020
@openjdk
Copy link

openjdk bot commented Dec 1, 2020

@calvinccheung
The hotspot-runtime label was successfully added.

@calvinccheung calvinccheung marked this pull request as ready for review December 1, 2020 19:34
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 1, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 1, 2020

Webrevs

@mlchung
Copy link
Member

mlchung commented Dec 1, 2020

The change looks okay. Can you add a test to verify that it won't load from CDS archive if disableEagerInitialization is true?

Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I agree with Mandy that we need a test case.

Copy link
Member

@cl4es cl4es left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@openjdk
Copy link

openjdk bot commented Dec 1, 2020

@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:

8257241: CDS should not handle disableEagerInitialization for archived lambda proxy classes

Reviewed-by: iklam, redestad, mchung

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 56 new commits pushed to the master branch:

  • 7104400: 8257164: Share LambdaForms for VH linkers/invokers
  • 3e89981: 8257623: vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001/TestDescription.java shouldn't use timeout
  • 93b6ab5: 8256818: SSLSocket that is never bound or connected leaks socket resources
  • 692b273: 8257189: Handle concurrent updates of MH.form better
  • 6704266: 8257565: epsilonBarrierSet.hpp should not include barrierSetAssembler
  • 0b8c780: 8256256: UL should not use heap allocation for output string
  • 2508bc7: 8257140: Crash in JvmtiTagMap::flush_object_free_events()
  • cfb50a9: 8253916: ResourceExhausted/resexhausted001 crashes on Linux-x64
  • 287b829: 8254877: GCLogPrecious::_lock rank constrains what locks you are allowed to have when crashing
  • 1fd0ea7: 8256382: Use try_lock for hs_err EventLog printing
  • ... and 46 more: https://git.openjdk.java.net/jdk/compare/6eb25d7cb42fb313172d90a56f231743cf6a7884...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 1, 2020
@calvinccheung
Copy link
Member Author

@mlchung, @iklam, @cl4es Thanks for the review.
I've added a test.

* from the archive.
* @requires vm.cds
* @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds
* @compile ../../../../../jdk/java/lang/invoke/lambda/LambdaEagerInitTest.java
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to make a copy of this test along side with this test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make a copy and put it under the open/test/hotspot/jtreg/runtime/cds/appcds/test-classes dir. I'd still need the @compile and would be something like @compile test-classes/LambdaEagerInitTest.java.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @compile can be avoiding by putting LambdaEagerInitTest into the @library and referencing it as

private static final String mainClass = LambdaEagerInitTest.class.getName();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @library test-classes works.

.shouldNotMatch(".cds.*Loaded.*lambda.*proxy")
.shouldHaveExitValue(0);

// run with archive without the -Djdk.internal.lambda.disableEagerInitialization=true property
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion: make this test case in a separate testWithEagerInitializationEnabled method. testImpl can be renamed to testWithEagerInitializationDisabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also factored out the archive creation into the createArchiveWithEagerInitializationEnabled method.

2. Modifications to LambdaEagerInit.java per review comments
*/

/**
* @test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of LambdaEagerInit test. This does not need to be @test and so the entire comment block can be removed.

If you want to verify, you could add a test case in LambdaEagerInit.java to run this main class without the CDS archive.

2. Add more test cases using the default CDS archive in LambdaEagerInit.java
@calvinccheung
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Dec 2, 2020
@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 2, 2020
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 2, 2020
@openjdk
Copy link

openjdk bot commented Dec 2, 2020

@calvinccheung Since your change was applied there have been 56 commits pushed to the master branch:

  • 7104400: 8257164: Share LambdaForms for VH linkers/invokers
  • 3e89981: 8257623: vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001/TestDescription.java shouldn't use timeout
  • 93b6ab5: 8256818: SSLSocket that is never bound or connected leaks socket resources
  • 692b273: 8257189: Handle concurrent updates of MH.form better
  • 6704266: 8257565: epsilonBarrierSet.hpp should not include barrierSetAssembler
  • 0b8c780: 8256256: UL should not use heap allocation for output string
  • 2508bc7: 8257140: Crash in JvmtiTagMap::flush_object_free_events()
  • cfb50a9: 8253916: ResourceExhausted/resexhausted001 crashes on Linux-x64
  • 287b829: 8254877: GCLogPrecious::_lock rank constrains what locks you are allowed to have when crashing
  • 1fd0ea7: 8256382: Use try_lock for hs_err EventLog printing
  • ... and 46 more: https://git.openjdk.java.net/jdk/compare/6eb25d7cb42fb313172d90a56f231743cf6a7884...master

Your commit was automatically rebased without conflicts.

Pushed as commit 3da30e9.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@calvinccheung calvinccheung deleted the 8257241-ignore-disableEagerInit branch December 2, 2020 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants