-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8263709: Cleanup THREAD/TRAPS/CHECK usage in JRT_ENTRY routines #3394
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 dholmes! A progress list of the required criteria for merging this PR into |
/cc hotspot-runtime |
@dholmes-ora |
Webrevs
|
@dholmes-ora |
@dholmes-ora 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.
I think substituting "JavaThread* thread" for "JavaThread* current" is a good change and convention that makes the code more clear, so worth the dull code review and diffs.
@dholmes-ora 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Looks like I missed some definitions that aren't included in our test builds but have been found via GHA builds. I will rectify those and update. |
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 big cleanup! LGTM
Harold
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.
LGTM
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.
Why you kept JavaThread *thread
parameter in some methods and renamed in others in deoptimization.* files.
src/hotspot/share/c1/c1_Runtime1.cpp
Outdated
RegisterMap reg_map(thread, false); | ||
frame runtime_frame = thread->last_frame(); | ||
static void deopt_caller(JavaThread* current) { | ||
if ( !caller_is_deopted(current)) { |
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.
Can you remove space after (
?
I also don't see changes in |
Mailing list message from David Holmes on hotspot-runtime-dev: Hi Vladimir, Thanks for looking at this. On 15/04/2021 9:52 am, Vladimir Kozlov wrote:
I only changed those parameters involved with JRT_* routines, as those Similarly for the lack of changes in the ci files - if they weren't
Sure. :) Thanks, |
1 similar comment
Mailing list message from David Holmes on hotspot-runtime-dev: Hi Vladimir, Thanks for looking at this. On 15/04/2021 9:52 am, Vladimir Kozlov wrote:
I only changed those parameters involved with JRT_* routines, as those Similarly for the lack of changes in the ci files - if they weren't
Sure. :) Thanks, |
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.
Okay.
Thanks for the review @vnkozlov ! David |
/integrate |
@dholmes-ora Pushed as commit 79bff21. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The existing JRT_ENTRY (and related) macros require the function to which they are applied to declare a parameter "JavaThread* thread" which represents the current thread. These functions are all implicitly "traps" functions as they can result in exceptions, but they are not declared with TRAPS because the only caller of these functions is the runtime itself (via call_VM) and no callers need to be aware to use CHECK; further they need a JavaThread. So the macro declares the THREAD variable for use with other exception-producing functions and assigns it from "thread".
The majority of this change replaces the parameter name "thread" with "current" so that it is clear that we are always dealing with the current thread. This affects the entry functions as well as the functions called therefrom.
We can then also replace the use of "THREAD" with "current", in contexts that are not related to exception processing.
Some methods called by entry functions were declared to have both a "thread" parameter and a "TRAPS" parameter - with nothing to tell you these are always the same, current, thread. So the "thread" parameter is removed and replaced with a local variable "current" obtained from THREAD->as_Java_thread().
Some missing CHECK_ uses were added.
Testing:
Thanks,
David
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3394/head:pull/3394
$ git checkout pull/3394
Update a local copy of the PR:
$ git checkout pull/3394
$ git pull https://git.openjdk.java.net/jdk pull/3394/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3394
View PR using the GUI difftool:
$ git pr show -t 3394
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3394.diff