-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8262227: Change SystemDictionary::find() to return an InstanceKlass*. #2712
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 hseigel! A progress list of the required criteria for merging this PR into |
@@ -448,8 +448,7 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass, | |||
kls = SystemDictionary::find_constrained_instance_or_array_klass(sym, loader, | |||
CHECK_AND_CLEAR_(fail_type)); | |||
} else { |
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 SystemDictionary::find_constrained_instance_or_array_klass can also be changed to accept a Thread*
instead TRAPS
, since now it can no longer throw, and the thread is used only for Mutexes.
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 Ioi, I'd like to do this in a separate RFE. Is that okay?
JDK_Version::set_runtime_vendor_vm_bug_url(get_java_runtime_vendor_vm_bug_url(THREAD)); | ||
InstanceKlass* ik = SystemDictionary::find_instance_klass(vmSymbols::java_lang_VersionProps(), | ||
Handle(), Handle()); | ||
JDK_Version::set_java_version(get_java_version(ik)); |
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 various get_java_xxx() functions all seem to do the same thing. I am wondering if they can be combined into a single utility function, so that you can do something like:
JDK_Version::set_runtime_name(get_version_info(ik, vmSymbols::java_version_name(),
java_version, sizeof(java_version)));
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 the get_java_* set of functions could be streamlined so that you pass in the symbol for the field you need. Also perhaps VersionProps could be a well-known class so we don't have to look it up. But this seems a future RFE. Even the current changes seem a little out-of-scope for this change.
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.
yes, this might be a useful change in a follow up RFE. What you have is good. You were going to change the lines anyway.
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 Ioi, I'd like to do this cleanup in a separate RFE. Is that okay?
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, I think it's OK to do the cleanups in different RFEs.
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.
Nice cleanup Harold! I'm more pleased with the TRAPS removal than the actual type change :)
Ref my comment in the bug report I'd overlooked that just because the return type of find changed, it didn't mean you have to change the type of the variable it was assigned to!
Thanks,
David
JDK_Version::set_runtime_vendor_vm_bug_url(get_java_runtime_vendor_vm_bug_url(THREAD)); | ||
InstanceKlass* ik = SystemDictionary::find_instance_klass(vmSymbols::java_lang_VersionProps(), | ||
Handle(), Handle()); | ||
JDK_Version::set_java_version(get_java_version(ik)); |
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 the get_java_* set of functions could be streamlined so that you pass in the symbol for the field you need. Also perhaps VersionProps could be a well-known class so we don't have to look it up. But this seems a future RFE. Even the current changes seem a little out-of-scope for this change.
@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 15 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 |
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 is more of a cleanup than I thought it'd be. Very nice!
Thanks Ioi, Coleen, and David for the reviews! /integrate |
@hseigel Since your change was applied there have been 16 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 29c603f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this fix for JDK-8262227. This fix changes SystemDictionary::find() to return an InstanceKlass* to reduce InstanceKlass casts, it renames find() to find_instance_klass(), removes its unneeded TRAP parameter, and changes its callers as appropriate.
It also changed the get_java_...() methods, in thread.cpp, to take an InstanceKlass* parameter and removed their now unneeded TRAPS parameter.
The fix was tested with mach5 tiers 1 and 2 on Linux, Windows, and Mac OS, and tiers 3-5 on Linux x64 (still in progress).
Thanks to Coleen and David for their helpful suggestions.
Thanks, Harold
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2712/head:pull/2712
$ git checkout pull/2712