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
8252685: APIs that require JavaThread should take JavaThread arguments #3877
Conversation
|
@dholmes-ora 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.
I started out thinking that this was too big and should be broken up but then the change is pretty simple to review and mostly mechanical. So ignore my comments to break it up. I think it's fine. Hitting "approve" even though it's a draft.
@@ -1074,7 +1074,7 @@ ClassPathEntry* find_first_module_cpe(ModuleEntry* mod_entry, | |||
|
|||
|
|||
// Search either the patch-module or exploded build entries for class. | |||
ClassFileStream* ClassLoader::search_module_entries(Thread* current, | |||
ClassFileStream* ClassLoader::search_module_entries(JavaThread* 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.
I wonder if these CDS and classLoader.hpp/cpp changes can be done first? Just change the caller to pass ->as_Java_thread() until TRAPS is changed.
@dholmes-ora this pull request can not be integrated into git checkout 8252685
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
Thanks for the pre-review comments Coleen! I started responding to your various comments then realized they were the ones about breaking things up that you said I could now ignore :) |
@dholmes-ora This change now passes all automated pre-integration checks. 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
|
src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp
Outdated
Show resolved
Hide resolved
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.
David,
This looks pretty good. At least, I do not see real problems.
It is really nice to make it more consistent.
Thanks,
Serguei
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.
Compiler related changes seems fine.
@dougxc, note that jvmci is affected. It looks reasonable for me but you may need to check if it is correct from libgraal POV.
I tried to test this patch against GraalVM but am blocked due to |
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
Mailing list message from David Holmes on hotspot-dev: On 11/05/2021 9:14 am, Serguei Spitsyn wrote:
Thanks for the review Serguei! David |
1 similar comment
Mailing list message from David Holmes on hotspot-dev: On 11/05/2021 9:14 am, Serguei Spitsyn wrote:
Thanks for the review Serguei! David |
Mailing list message from David Holmes on hotspot-dev: On 11/05/2021 9:00 am, Serguei Spitsyn wrote:
Changed. |
1 similar comment
Mailing list message from David Holmes on hotspot-dev: On 11/05/2021 9:00 am, Serguei Spitsyn wrote:
Changed. |
Mailing list message from David Holmes on hotspot-dev: On 13/05/2021 1:29 pm, Vladimir Kozlov wrote:
Thanks for the review Vladimir! cc'ing Doug in case the @-notification doesn't work. David |
1 similar comment
Mailing list message from David Holmes on hotspot-dev: On 13/05/2021 1:29 pm, Vladimir Kozlov wrote:
Thanks for the review Vladimir! cc'ing Doug in case the @-notification doesn't work. David |
Mailing list message from David Holmes on hotspot-dev: Thanks for the review Ioi! David On 14/05/2021 3:03 am, Ioi Lam wrote: |
1 similar comment
Mailing list message from David Holmes on hotspot-dev: Thanks for the review Ioi! David On 14/05/2021 3:03 am, Ioi Lam wrote: |
/integrate |
@dholmes-ora Pushed as commit 02f895c. |
Our code is littered with API's that take, or manifest, a Thread* and then assert/guarantee that it must be a JavaThread, rather than taking/manifesting a JavaThread in the first place. The main reason for this is that the TRAPS macro, used in relation to exception generation and processing, is declared as "Thread* THREAD". In practice only JavaThreads that can execute Java code can generate arbitrary exceptions, because it requires executing Java code. In other places we can get away with other kinds of threads "throwing" exceptions because they are only pre-allocated instances that require no Java code execution (e.g. OOME), or when executed by a non-JavaThread the code actually by-passes the logic would throw an exception. Such code also eventually clears the exception and reports the OOM by some other means. We have been progressively untangling these code paths and modifying TRAPS/CHECK usage so that only JavaThreads will call TRAPS methods and throw exceptions. Having done that pre-work we are now ready to convert TRAPS to be "JavaThread* THREAD" and that is what this change does. The resulting changes are largely mechanical:
There are still places where a CompilerThread (which is a JavaThread but may not be able to execute Java code) calls a TRAPS function (primarily where OOME is possible). Fixing that would be a future RFE and may not be possible without reworking a lot of the allocation code paths.
Testing:
Thanks,
David
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3877/head:pull/3877
$ git checkout pull/3877
Update a local copy of the PR:
$ git checkout pull/3877
$ git pull https://git.openjdk.java.net/jdk pull/3877/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3877
View PR using the GUI difftool:
$ git pr show -t 3877
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3877.diff