-
Notifications
You must be signed in to change notification settings - Fork 120
8364034: [lworld] Pre-register boxing classes in class loaders #1517
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
Conversation
👋 Welcome back fparain! A progress list of the required criteria for merging this PR into |
@fparain 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 120 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 |
Webrevs
|
Are we planning to register Optional next? And do we have a measure for how far the eager registration would go? |
Optional requires a different set of changes because it is not currently a class known by the JVM. |
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 came out quite nice by reusing the similar CDS code.
ClassLoaderDataGraph::find_or_create(class_loader); | ||
} | ||
if (class_loader() != nullptr && cld->dictionary() != nullptr) { |
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 this can just go in the 'else' statement and then you don't have to test if the dictionary is null. Also, rather than ADD_WRAPPER_CLASS, can you make it function that takes the whole name with vmSymbols::java_lang_ since I think you anticipate adding other classes to this.
To this static function, pass JavaThread* current as the first parameter, so it doesn't have to call Thread::current() for each Handle. It's not that bad for performance anymore but I still don't like that we have it.
Maybe:
static void add_wrapper_class(JavaThread* current, Symbol* classname).
assert_locked_or_safepoint(SystemDictionary_lock); | ||
Symbol* name = k->name(); | ||
Dictionary* dictionary = loader_data->dictionary(); | ||
assert(k->is_loaded(), "must be"); | ||
assert(k->class_loader_data() != loader_data, "only for classes defined by a parent loader"); | ||
assert(dictionary->find_class(current, name) == nullptr, "sanity"); | ||
dictionary->add_klass(current, name, k); | ||
if (dictionary->find_class(current, name) == nullptr) { |
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.
You could also keep the assert and have it be:
assert(!CDSConfig::is_using_aot_linked_classes() || dictionary->find_class() == nullptr, "Ioi would like this probably");
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.
Oh, no this assert isn't right because you add wrapper classes when using_aot_linked_classes too. Never mind this.
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 looks good.
Coleen, |
/integrate |
Going to push as commit 57a9aef.
Your commit was automatically rebased without conflicts. |
Add pre-registration of boxing classes when a class loader is registered by the VM.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1517/head:pull/1517
$ git checkout pull/1517
Update a local copy of the PR:
$ git checkout pull/1517
$ git pull https://git.openjdk.org/valhalla.git pull/1517/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1517
View PR using the GUI difftool:
$ git pr show -t 1517
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1517.diff
Using Webrev
Link to Webrev Comment