RFR: 8268368: Adopt cast notation for JavaThread conversions [v2]
David Holmes
david.holmes at oracle.com
Tue Jun 22 11:33:57 UTC 2021
On 22/06/2021 5:24 pm, Guoxiong Li wrote:
> On Tue, 22 Jun 2021 01:59:17 GMT, David Holmes <dholmes at openjdk.org> wrote:
>
>>> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision:
>>>
>>> Fix incorrect use of the method cast
>>
>> Hi Guoxiong,
>>
>> Thanks for picking up this enhancement request.
>>
>> I wasn't sure if this would be worth the churn/disruption to the source code, but I think it is ok and preferable to use the cast notation.
>>
>> The changes look good except for one mistake flagged below.
>>
>> Note you need at least two reviewers before integrating this.
>>
>> Thanks,
>> David
>
> @dholmes-ora Thanks for your review. I updated the code just now.
>
> I am surprised that the `tier1` (locally and the `Pre-submit tests`) can't find the mistake you pointed out.
> Maybe we can improve the `tier1` or the `Pre-submit tests` in the future.
The error is in ZGC code and ZGC is not tested in tier-1 or pre-submit.
Cheers,
David
>> src/hotspot/share/gc/z/zFuture.inline.hpp line 49:
>>
>>> 47: // Wait for notification
>>> 48: Thread* const thread = Thread::current();
>>> 49: if (JavaThread::cast(thread)) {
>>
>> This is wrong - we still need the is_Java_thread() query; and cast is not a boolean operator.
>
> Fixed. It's a wrong use of the method `cast`. Thanks for finding it. I re-read my patch to avoid the similar mistake.
>
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/4546
>
More information about the serviceability-dev
mailing list