RFR: 8356778: Compiler add event logging in case of failures
Lutz Schmidt
lucy at openjdk.org
Thu May 15 20:33:54 UTC 2025
On Thu, 15 May 2025 16:03:58 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> What if I create a new call like
>>
>> char* myMsg = nullptr;
>> . . .
>> bailout(myMsg);
>>
>> and, due to complicated logic, `myMsg` is not assigned a value in all cases? General topic: future-proof code.
>
> I could live with the check, but we get other problems when it is nullptr because nullptr is interpreted as no bailout!
> `bool bailed_out() const { return _bailout_msg != nullptr; }`
OK, with that knowledge and without the check, we crash when we try to log the null message. Otherwise, we crash or fail sometime later - or some strange things happen.
If we follow the "fail early" principle, the additional check should not be there. We could as well convert the assert into a guarantee to enforce a "planned" crash.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25188#discussion_r2091914815
More information about the hotspot-compiler-dev
mailing list