Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v8]

2020-09-10 Thread Daniel D . Daugherty
On Thu, 10 Sep 2020 03:18:23 GMT, David Holmes wrote: >> This is a rather large but generally simple cleanup. >> >> We use a lot of raw C-style casts to "(JavaThread*)" typically after >> checking "thread->is_Java_thread()". To simplify >> this pattern, and make the code look somewhat cleaner w

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v8]

2020-09-09 Thread Kim Barrett
On Thu, 10 Sep 2020 03:18:23 GMT, David Holmes wrote: >> This is a rather large but generally simple cleanup. >> >> We use a lot of raw C-style casts to "(JavaThread*)" typically after >> checking "thread->is_Java_thread()". To simplify >> this pattern, and make the code look somewhat cleaner w

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v8]

2020-09-09 Thread David Holmes
> This is a rather large but generally simple cleanup. > > We use a lot of raw C-style casts to "(JavaThread*)" typically after checking > "thread->is_Java_thread()". To simplify > this pattern, and make the code look somewhat cleaner we introduce a > convenience function Thread::as_Java_thread(

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v7]

2020-09-09 Thread David Holmes
Hi Dan, Thanks for looking at this one. On 10/09/2020 9:26 am, Daniel D.Daugherty wrote: On Wed, 9 Sep 2020 14:06:02 GMT, Kim Barrett wrote: David Holmes has updated the pull request incrementally with one additional commit since the last revision: Reverted to the original code as the e

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v7]

2020-09-09 Thread Daniel D . Daugherty
On Wed, 9 Sep 2020 12:48:11 GMT, David Holmes wrote: >> This is a rather large but generally simple cleanup. >> >> We use a lot of raw C-style casts to "(JavaThread*)" typically after >> checking "thread->is_Java_thread()". To simplify >> this pattern, and make the code look somewhat cleaner we

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v7]

2020-09-09 Thread Daniel D . Daugherty
On Wed, 9 Sep 2020 23:24:26 GMT, Daniel D. Daugherty wrote: >> Marked as reviewed by kbarrett (Reviewer). > > This is a really nice set of cleanup changes. > > I have a few comments. > > https://openjdk.github.io/cr/?repo=jdk&pr=37&range=06#frames-33 > 51 if (thread->is_Java_thread()) > 5

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v7]

2020-09-09 Thread Daniel D . Daugherty
On Wed, 9 Sep 2020 14:06:02 GMT, Kim Barrett wrote: >> David Holmes has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Reverted to the original code as the explicit assertion is preferred. > > Marked as reviewed by kbarrett (Reviewer). Thi

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v7]

2020-09-09 Thread Kim Barrett
On Wed, 9 Sep 2020 12:48:11 GMT, David Holmes wrote: >> This is a rather large but generally simple cleanup. >> >> We use a lot of raw C-style casts to "(JavaThread*)" typically after >> checking "thread->is_Java_thread()". To simplify >> this pattern, and make the code look somewhat cleaner we

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-09 Thread David Holmes
Trimming ... On 9/09/2020 7:09 pm, Kim Barrett wrote: src/hotspot/share/gc/shared/concurrentGCBreakpoints.cpp 63 #define assert_Java_thread() \ 64 assert(Thread::current()->is_Java_thread(), "precondition") 65 66 void ConcurrentGCBreakpoints::run_to_idle_impl(bool acquiring_control) {

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v7]

2020-09-09 Thread David Holmes
> This is a rather large but generally simple cleanup. > > We use a lot of raw C-style casts to "(JavaThread*)" typically after checking > "thread->is_Java_thread()". To simplify > this pattern, and make the code look somewhat cleaner we introduce a > convenience function Thread::as_Java_thread(

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-09 Thread Kim Barrett
Hi David. Thanks for clarifying some bits I was confused abut. >> src/hotspot/share/jvmci/jvmciEnv.cpp >> 243 void JVMCIEnv::describe_pending_exception(bool clear) { >> 244 JavaThread* THREAD = JavaThread::current(); >> This change looks suspicious. The old code used Thread::current() here a

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v6]

2020-09-09 Thread David Holmes
> This is a rather large but generally simple cleanup. > > We use a lot of raw C-style casts to "(JavaThread*)" typically after checking > "thread->is_Java_thread()". To simplify > this pattern, and make the code look somewhat cleaner we introduce a > convenience function Thread::as_Java_thread(

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-09 Thread David Holmes
Hi Kim, On 9/09/2020 1:30 pm, Kim Barrett wrote: On Sep 8, 2020, at 9:27 AM, David Holmes wrote: David Holmes has updated the pull request incrementally with one additional commit since the last revision: This is a simpler approach to use the static_cast. Changes: - Change C-style cast to

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-08 Thread Kim Barrett
> On Sep 8, 2020, at 11:30 PM, Kim Barrett wrote: > > I reviewed all of v4, not just the gc parts this time. I guess it was v5 I was reviewing. There seems to be an inconsistency in numbering.

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-08 Thread Kim Barrett
> On Sep 8, 2020, at 9:27 AM, David Holmes wrote: > David Holmes has updated the pull request incrementally with one additional > commit since the last revision: > > This is a simpler approach to use the static_cast. Changes: > - Change C-style cast to static_cast and move function definitions

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v4]

2020-09-08 Thread Kim Barrett
> On Sep 8, 2020, at 6:06 AM, David Holmes wrote: > > Just to be clear please wait for v5 to appear before reviewing. I think you meant “v4”, i.e. the 5th zero-based version?

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-08 Thread David Holmes
Thanks for the review Coleen! David On 9/09/2020 5:10 am, Coleen Phillimore wrote: On Tue, 8 Sep 2020 19:07:01 GMT, Coleen Phillimore wrote: David Holmes has updated the pull request incrementally with one additional commit since the last revision: This is a simpler approach to use the

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-08 Thread Coleen Phillimore
On Tue, 8 Sep 2020 13:27:17 GMT, David Holmes wrote: >> This is a rather large but generally simple cleanup. >> >> We use a lot of raw C-style casts to "(JavaThread*)" typically after >> checking "thread->is_Java_thread()". To simplify >> this pattern, and make the code look somewhat cleaner we

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-08 Thread Coleen Phillimore
On Tue, 8 Sep 2020 19:07:01 GMT, Coleen Phillimore wrote: >> David Holmes has updated the pull request incrementally with one additional >> commit since the last revision: >> >> This is a simpler approach to use the static_cast. Changes: >> - Change C-style cast to static_cast and move func

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v5]

2020-09-08 Thread David Holmes
> This is a rather large but generally simple cleanup. > > We use a lot of raw C-style casts to "(JavaThread*)" typically after checking > "thread->is_Java_thread()". To simplify > this pattern, and make the code look somewhat cleaner we introduce a > convenience function Thread::as_Java_thread(

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v4]

2020-09-08 Thread David Holmes
Just to be clear please wait for v5 to appear before reviewing. Thanks, David On 8/09/2020 7:34 pm, David Holmes wrote: This is a rather large but generally simple cleanup. We use a lot of raw C-style casts to "(JavaThread*)" typically after checking "thread->is_Java_thread()". To simplify th

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v2]

2020-09-08 Thread Kim Barrett
> On Sep 8, 2020, at 3:00 AM, David Holmes wrote: > > On 8/09/2020 4:34 pm, Kim Barrett wrote: >> […] >> src/hotspot/share/runtime/thread.hpp >> 507 const JavaThread* as_const_Java_thread() const; >> This missed part of what I'd suggested. I don't think the "const" part >> of the name is need

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v4]

2020-09-08 Thread David Holmes
> This is a rather large but generally simple cleanup. > > We use a lot of raw C-style casts to "(JavaThread*)" typically after checking > "thread->is_Java_thread()". To simplify > this pattern, and make the code look somewhat cleaner we introduce a > convenience function Thread::as_Java_thread(

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v2]

2020-09-08 Thread David Holmes
On 8/09/2020 4:34 pm, Kim Barrett wrote: On Sep 8, 2020, at 12:09 AM, David Holmes wrote: David Holmes has updated the pull request incrementally with one additional commit since the last revision: Used static_cast instead of raw C-style cast Moved inline functions to thread.inline.hpp U

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v3]

2020-09-07 Thread Aleksey Shipilev
On Tue, 8 Sep 2020 04:38:43 GMT, David Holmes wrote: >> This is a rather large but generally simple cleanup. >> >> We use a lot of raw C-style casts to "(JavaThread*)" typically after >> checking "thread->is_Java_thread()". To simplify >> this pattern, and make the code look somewhat cleaner we

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v2]

2020-09-07 Thread Kim Barrett
> On Sep 8, 2020, at 12:09 AM, David Holmes wrote: > David Holmes has updated the pull request incrementally with one additional > commit since the last revision: > > Used static_cast instead of raw C-style cast > Moved inline functions to thread.inline.hpp > Updated #includes to deal with th

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v3]

2020-09-07 Thread David Holmes
> This is a rather large but generally simple cleanup. > > We use a lot of raw C-style casts to "(JavaThread*)" typically after checking > "thread->is_Java_thread()". To simplify > this pattern, and make the code look somewhat cleaner we introduce a > convenience function Thread::as_Java_thread(

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function [v2]

2020-09-07 Thread David Holmes
> This is a rather large but generally simple cleanup. > > We use a lot of raw C-style casts to "(JavaThread*)" typically after checking > "thread->is_Java_thread()". To simplify > this pattern, and make the code look somewhat cleaner we introduce a > convenience function Thread::as_Java_thread(

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function

2020-09-07 Thread David Holmes
Hi Kim, Thanks for taking a look. On 8/09/2020 9:23 am, Kim Barrett wrote: On Sep 7, 2020, at 5:47 PM, David Holmes wrote: […] Commit messages: - Initial changes for 8252406 Changes: https://git.openjdk.java.net/jdk/pull/37/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=37&range

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function

2020-09-07 Thread Kim Barrett
> On Sep 7, 2020, at 5:47 PM, David Holmes wrote: > > […] > Commit messages: > - Initial changes for 8252406 > > Changes: https://git.openjdk.java.net/jdk/pull/37/files > Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=37&range=00 > Issue: https://bugs.openjdk.java.net/browse/JDK-8252406

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function

2020-09-07 Thread David Holmes
On Mon, 7 Sep 2020 13:37:10 GMT, Aleksey Shipilev wrote: >> This is a rather large but generally simple cleanup. >> >> We use a lot of raw C-style casts to "(JavaThread*)" typically after >> checking "thread->is_Java_thread()". To simplify >> this pattern, and make the code look somewhat cleane

Re: RFR: 8252406: Introduce Thread::as_Java_thread() convenience function

2020-09-07 Thread Aleksey Shipilev
On Mon, 7 Sep 2020 05:56:14 GMT, David Holmes wrote: > This is a rather large but generally simple cleanup. > > We use a lot of raw C-style casts to "(JavaThread*)" typically after checking > "thread->is_Java_thread()". To simplify > this pattern, and make the code look somewhat cleaner we intr