RFR: 8370441: Remove unnecessary/confusing null check in Verifier::verify() [v2]
David Holmes
dholmes at openjdk.org
Tue Jan 20 23:30:12 UTC 2026
On Tue, 20 Jan 2026 12:17:36 GMT, Paul Hübner <phubner at openjdk.org> wrote:
>> [JDK-8059924](https://bugs.openjdk.org/browse/JDK-8059924) introduced a nullcheck for a klass' Java mirror which runs during verification. However, in the modern VM, during verification time, the mirror is guaranteed to exist making the check unnecessary and misleading when reading the code. While implementing [JDK-8366488](https://bugs.openjdk.org/browse/JDK-8366488) it caused for quite some confusion. With this PR it is my intention to make sure that nobody gets side-tracked by this impossible condition.
>>
>> For an insight into previous discussion on this topic, please see the associated JBS issue.
>>
>> Testing: tiers 1-5 on Linux x64, AArch64, macOS x64, AArch64, Windows x64.
>
> Paul Hübner has updated the pull request incrementally with two additional commits since the last revision:
>
> - Keep the rest of the code.
> - Revert "Turn check into an assert."
>
> This reverts commit 78fa2983b532c4b390720316e79c975e61a4152a.
Looks good.
The analysis seems correct and I agree that checking for impossible conditions is confusing.
Thanks
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/29314#pullrequestreview-3684716491
More information about the hotspot-runtime-dev
mailing list