-
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
8312623: SA add NestHost and NestMembers attributes when dumping class #15005
Conversation
Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
👋 Welcome back ashu-mehra! A progress list of the required criteria for merging this PR into |
@ashu-mehra The following labels will be automatically applied to this pull request:
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. |
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 good.
@ashu-mehra 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 126 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@plummercj, @sspitsyn, @tstuefe) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, 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.
Looks good.
Thanks,
Serguei
We need to be sure this works as expected for top-level classes that have no nest members, and deeply nested nest members, plus dynamically injected hidden classes that are nest members. I'm unclear if this is intended to only expose the same details as would be statically defined in the attribute in the classfile? |
@dholmes-ora sorry for responding late. I got sidetracked by some other work.
I am not sure I understand this concern. We are getting nest-host and nest-members from the InstanceKlass. As long as this information is recorded in InstanceKlass, it would work. Can you please elaborate your concern about the cases you feel may not work.
It is to expose the details as the JVM sees, which may be different from what is statically defined in the classfile if agents are involved. |
@ashu-mehra you indicated that you had only done two basic manual tests to check the output. You need to check it for the cases that I flagged too. In the VM every top-level class is its own nest-host, but that is not expressed in a classfile attribute (it is just the defined semantics) so displaying this as-if it were an explicit attribute may not be right. |
@dholmes-ora I confirmed there is no nest-host or nest-members attributes generated by this patch for a top level class which doesn't have any nest-members. Is that what you wanted to verify? |
@ashu-mehra That was one case. I also want to know that you have tested deeply nested classes; and hidden classes (if applicable). Thanks. |
@dholmes-ora I verified the case for hidden dynamically injected classes. The dumped class data for a hidden dynamically injected class does not have any Nest-Host attribute. When generating these classes dynamically the VM does not expose nest-host information in the class data, but sets the nest-host directly in the InstanceKlass. Also verified the case for deeply nested classes by creating chain of nested classes as:
Only Does this cover all the cases you flagged? |
@ashu-mehra thanks for doing the additional testing. Pity there is no regression/functional test for this. |
@dholmes-ora @plummercj I have improved dumpclass tests to cover up some cases for this PR and JDK-8311971. If the tests makes sense I would like to include it in this PR. Is that okay? |
I think given the scope of the changes it would be better to do this with a "Improve SA dumpclass testing" CR/PR. |
Okay. I guess this can then be integrated as is. Thanks for the reviews. |
/integrate |
@ashu-mehra |
@plummercj can you please sponsor it. |
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.
Belatedly, and unnecessary since you have two reviews, but this looks good to me too.
/sponsor |
Going to push as commit 873d117.
Your commit was automatically rebased without conflicts. |
@plummercj @ashu-mehra Pushed as commit 873d117. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Thanks every one for reviewing this PR. |
This patch adds NestHost and NestMembers attributes to the class dumped by SA.
Testing:
test/hotspot/jtreg/serviceability/sa
andtest/jdk/sun/tools/jhsdb
Manual testing by dumping
j.l.String
andj.l.String$CaseInsensitiveComparator
classes.j.l.String
shows one entry inNestMembers
attribute forj.l.String$CaseInsensitiveComparator
andj.l.String$CaseInsensitiveComparator
hasj.l.String
as itsNestHost
.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15005/head:pull/15005
$ git checkout pull/15005
Update a local copy of the PR:
$ git checkout pull/15005
$ git pull https://git.openjdk.org/jdk.git pull/15005/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15005
View PR using the GUI difftool:
$ git pr show -t 15005
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15005.diff
Webrev
Link to Webrev Comment