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

8280767: -XX:ArchiveClassesAtExit does not archive BoundMethodHandle$Species classes #7329

Closed
wants to merge 6 commits into from

Conversation

yminqi
Copy link
Contributor

@yminqi yminqi commented Feb 2, 2022

Hi, Please review

When do dynamic dump, the call to LambdaForInvolkers::append_filtered for generating lambda holder classes will only allow the result which matches the filtering list to be added . This filters out the SPECIES method handle holder classes, and they won't be archived in dynamic shared archive. The patch is doing followings:

  1. Removed the call to LambdaForInvolkers::append_filtered, instead just call LambdaForInvolkers::append so the SPECIES can be added to the regeneration list.
  2. Added an enum for shared flag in Klass, _generated to indicate the class is regenerated and it should not be loaded from CDS if CFLH is enabled. If the class is a SPECIES and also loaded from base archive, skip regenerating it for dynamic archive.
  3. If CFLH is enabled, for regenerated classes, avoid calling CFLH.

Tests: tier1,tier4

Thanks
Yumin


Progress

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

Issue

  • JDK-8280767: -XX:ArchiveClassesAtExit does not archive BoundMethodHandle$Species classes

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7329/head:pull/7329
$ git checkout pull/7329

Update a local copy of the PR:
$ git checkout pull/7329
$ git pull https://git.openjdk.java.net/jdk pull/7329/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7329

View PR using the GUI difftool:
$ git pr show -t 7329

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7329.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 2, 2022

👋 Welcome back minqi! 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 Feb 2, 2022

@yminqi The following label will be automatically applied to this pull request:

  • hotspot

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

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Feb 2, 2022
@yminqi
Copy link
Contributor Author

yminqi commented Feb 3, 2022

/label remove hotspot
/label add hotspot-runtime

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label Feb 3, 2022
@openjdk
Copy link

openjdk bot commented Feb 3, 2022

@yminqi
The hotspot label was successfully removed.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Feb 3, 2022
@openjdk
Copy link

openjdk bot commented Feb 3, 2022

@yminqi
The hotspot-runtime label was successfully added.

@yminqi yminqi marked this pull request as ready for review February 3, 2022 02:51
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 3, 2022
@mlbridge
Copy link

mlbridge bot commented Feb 3, 2022

Webrevs

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. A small nit on the comments.

@@ -1415,6 +1415,10 @@ InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) {
if (record != NULL) {
assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");
assert(check_alignment(record->_klass), "Address not aligned");
// The regenerated lamdbda Holder classes are not saved, should avoid call CFLH
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 will be clear to say

// We did not save the classfile data of the regenerated LambdaForm invoker classes,
// so we cannot support CLFH for such classes. 

@openjdk
Copy link

openjdk bot commented Feb 4, 2022

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

8280767: -XX:ArchiveClassesAtExit does not archive BoundMethodHandle$Species classes

Reviewed-by: iklam, ccheung

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

  • f5d6fdd: 8280476: [macOS] : hotspot arm64 bug exposed by latest clang
  • d4b99bc: 8281120: G1: Rename G1BlockOffsetTablePart::alloc_block to update_for_block
  • 66b2c3b: 8280948: [TESTBUG] Write a regression test for JDK-4659800
  • 7207f2a: Merge
  • 01f93dd: 8279385: [test] Adjust sun/security/pkcs12/KeytoolOpensslInteropTest.java after 8278344
  • 3d926dd: 8277795: ldap connection timeout not honoured under contention
  • 51b53a8: 8280913: Create a regression test for JRootPane.setDefaultButton() method
  • 46c6c6f: 8281043: Intrinsify recursive ObjectMonitor locking for PPC64
  • c936e70: 8280593: [PPC64, S390] redundant allocation of MacroAssembler in StubGenerator ctor
  • 63e11cf: 8280970: Cleanup dead code in java.security.Provider
  • ... and 13 more: https://git.openjdk.java.net/jdk/compare/fe0118f8040ce7e5e3d605942443e3a5d442fa92...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 Feb 4, 2022
Comment on lines 59 to 60
.assertNormalExit(output -> {
output.shouldContain("java.lang.invoke.BoundMethodHandle$Species_JL source: shared objects file (top)");
Copy link
Member

Choose a reason for hiding this comment

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

Please add a comment indicating the "species" class is from the "CDSLambdaInvoker" test program.

Copy link
Member

@calvinccheung calvinccheung 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. Please add a comment in the test case.

@yminqi
Copy link
Contributor Author

yminqi commented Feb 4, 2022

@iklam @calvinccheung Thanks for review

@yminqi
Copy link
Contributor Author

yminqi commented Feb 4, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Feb 4, 2022

Going to push as commit 8e4ef81.
Since your change was applied there have been 23 commits pushed to the master branch:

  • f5d6fdd: 8280476: [macOS] : hotspot arm64 bug exposed by latest clang
  • d4b99bc: 8281120: G1: Rename G1BlockOffsetTablePart::alloc_block to update_for_block
  • 66b2c3b: 8280948: [TESTBUG] Write a regression test for JDK-4659800
  • 7207f2a: Merge
  • 01f93dd: 8279385: [test] Adjust sun/security/pkcs12/KeytoolOpensslInteropTest.java after 8278344
  • 3d926dd: 8277795: ldap connection timeout not honoured under contention
  • 51b53a8: 8280913: Create a regression test for JRootPane.setDefaultButton() method
  • 46c6c6f: 8281043: Intrinsify recursive ObjectMonitor locking for PPC64
  • c936e70: 8280593: [PPC64, S390] redundant allocation of MacroAssembler in StubGenerator ctor
  • 63e11cf: 8280970: Cleanup dead code in java.security.Provider
  • ... and 13 more: https://git.openjdk.java.net/jdk/compare/fe0118f8040ce7e5e3d605942443e3a5d442fa92...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 4, 2022

@yminqi Pushed as commit 8e4ef81.

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

@yminqi yminqi deleted the jdk-8280767 branch February 4, 2022 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
3 participants