RFR: 8269466: Factor out the common code for initializing and starting internal VM JavaThreads [v3]
David Holmes
dholmes at openjdk.java.net
Thu Jul 1 22:05:59 UTC 2021
On Thu, 1 Jul 2021 17:33:02 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/compiler/compileBroker.cpp line 909:
>>
>>> 907: // JavaThread due to lack of resources. We will handle that failure below.
>>> 908:
>>> 909: if (new_thread->osthread() != NULL) {
>>
>> I think you do need to check `new_thread != NULL` here to please Parfait for `default:` case.
>
> Really? We have this sort of code everywhere. We don't check the result of a new expression anywhere else.
It isn't the result of the new expression that needs checking. The switch statement has a default: clause which calls ShouldNotReachHere(). IIRC Parfait does not understand things like ShouldNotReachHere() never return, and so it thinks "new_thread" may still be NULL if we followed the default: path through the switch.
I will restore this NULL check with a comment.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4629
More information about the hotspot-compiler-dev
mailing list