RFR: Remove redundant null checks [v8]

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Jan 26 11:36:53 UTC 2026


On Mon, 26 Jan 2026 10:43:48 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> some of the null checks javac generates are redundant and can be removed
>
> Vicente Romero has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision:
> 
>  - Merge branch 'bworld' into remove.redundant.null.checks
>  - minor change
>  - addressing review comments
>  - adding test cases
>  - adding more tests
>  - adding more tests
>  - minor change
>  - another change
>  - regression tests
>  - remove redundant null checks
>  - ... and 2 more: https://git.openjdk.org/valhalla/compare/5edfd698...37939f06

Changes look good -- I think the code in `NullChecksWriter::visitTypeCast` can now be simplified to always call `attr.makeNullCheck` (if cast is strict), as the method in Attr now has sufficient smarts to omit the conversion if not required.

-------------

Marked as reviewed by mcimadamore (Committer).

PR Review: https://git.openjdk.org/valhalla/pull/1947#pullrequestreview-3705646835


More information about the valhalla-dev mailing list