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
8243287: Removal of Unsafe::defineAnonymousClass #3974
Conversation
👋 Welcome back hseigel! A progress list of the required criteria for merging this PR into |
@hseigel 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. |
Webrevs
|
/csr needed |
@hseigel this pull request will not be integrated until the CSR request JDK-8266760 for issue JDK-8243287 has been approved. |
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 CDS VM and test changes look OK to me.
@@ -50,7 +50,7 @@ public static String getSimpleName(Class<?> clazz, boolean withEnclosingClass) { | |||
} | |||
return simpleName; | |||
} | |||
// Must be an anonymous or local class | |||
// Must be a local class |
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.
This file should not be changed. It refers to the Java language anonymous class (not VM anonymous class).
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.
Changes have been restored.
@hseigel 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 43 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 |
I reviewed java.base and took a pass on the test changes. Here are some comments: test/hotspot/jtreg/runtime/HiddenClasses/TestHiddenClassUnloading.java has this comment:
This comment can be removed as this test will be removed. A few tests under test/hotspot/jtreg/runtime/HiddenClasses also have similar comment that should be removed. test/hotspot/jtreg/vmTestbase/vm/mlvm/anonloader/func/castToGrandparent/Test.java
test/hotspot/jtreg/vmTestbase/vm/mlvm/anonloader/share/StressClassLoadingTest.java
test/jdk/java/lang/invoke/VMAnonymousClass.java
|
Thanks Alan, Ioi, and Mandy for looking at this. The latest changes should address the issues that you found. |
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.
Overall looks good to me.
@@ -36,7 +36,6 @@ | |||
import static java.lang.invoke.MethodHandles.Lookup.ClassOption.*; | |||
import jdk.test.lib.compiler.InMemoryJavaCompiler; | |||
|
|||
// This test is based on vmTestbase/vm/mlvm/anonloader/share/StressClassLoadingTest.java | |||
public class StressHiddenClasses { |
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.
Since StressClassLoadingTest
is revised to test hidden class, this test is a subset of it.
I think this can be removed as JDK-8265694 suggests.
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.
Thanks Mandy. I will remove the test as the fix for JDK-8265694 after this change is pushed.
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.
Hi Harold,
Big change! :) This looks good. All the removals of references to unsafe_anonymous were easy enough to follow.
I didn't realize that cp patching and psuedo-strings were only related to VM anonymous. It is good to see all that code go as well (but hard to see if you got it all :) ). But as per comment below are we sure psuedo-strings can't be used elsewhere?
Thanks,
David
// Methods internally created for method handles may also | ||
// use pseudo-strings to link themselves to related metaobjects. |
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.
Is this comment wrong? Are psuedo-strings not used by anything now?
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.
Thanks for looking at this. I discussed pseudo strings with Coleen and we didn't find any use of them besides unsafe.DefineAnonymousClass.
Thanks Ioi, Alan, Mandy, and David for reviewing this big change! /integrate |
@hseigel Since your change was applied there have been 43 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit e14b026. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Mailing list message from Brian Goetz on hotspot-dev: There may be some JDK code that checks for anon classes by comparing the name to see if it contains a slash, especially tests, but which don?t say ?anonymous?. Did you do a search for these idioms too, which are now dead tests? Sent from my iPad |
Mailing list message from Harold Seigel on hotspot-dev: Hi Brian, Thanks for looking at this. The JDK no longer creates unsafe anon classes.? So, those tests could If there are dead tests then they probably died when the JDK stopped Harold On 5/11/2021 9:20 AM, Brian Goetz wrote:
|
1 similar comment
Mailing list message from Harold Seigel on hotspot-dev: Hi Brian, Thanks for looking at this. The JDK no longer creates unsafe anon classes.? So, those tests could If there are dead tests then they probably died when the JDK stopped Harold On 5/11/2021 9:20 AM, Brian Goetz wrote:
|
Mailing list message from Mandy Chung on hotspot-dev: I did a search on java.base and the tests on `String::indexOf` and Mandy On 5/11/21 6:20 AM, Brian Goetz wrote:
|
Mailing list message from Brian Goetz on hotspot-dev: Thanks for checking.? I thought I remembered something like this Cheers, On 5/13/2021 2:50 PM, Mandy Chung wrote:
|
Mailing list message from Mandy Chung on hotspot-dev: I did a search on java.base and the tests on `String::indexOf` and Mandy On 5/11/21 6:20 AM, Brian Goetz wrote:
|
Mailing list message from Mandy Chung on hotspot-dev: Maybe you were thinking [1] On 5/13/21 12:03 PM, Brian Goetz wrote:
|
Mailing list message from Brian Goetz on hotspot-dev: Thanks for checking.? I thought I remembered something like this Cheers, On 5/13/2021 2:50 PM, Mandy Chung wrote:
|
Mailing list message from Mandy Chung on hotspot-dev: Maybe you were thinking [1] On 5/13/21 12:03 PM, Brian Goetz wrote:
|
Please review this large change to remove Unsafe::defineAnonymousClass(). The change removes dAC relevant code and changes a lot of tests. Many of the changed tests need renaming. I hope to do this in a follow up RFE. Some of the tests were modified to use hidden classes, others were deleted because either similar hidden classes tests already exist or they tested dAC specific functionality, such as host classes.
This change was tested with Mach5 tiers 1-2 on Linux, Mac OS, and Windows, and Mach5 tiers 3-7 on Linux x64.
Thanks, Harold
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3974/head:pull/3974
$ git checkout pull/3974
Update a local copy of the PR:
$ git checkout pull/3974
$ git pull https://git.openjdk.java.net/jdk pull/3974/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3974
View PR using the GUI difftool:
$ git pr show -t 3974
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3974.diff