Integrated: 8281732: add assert for non-NULL assumption for return of unique_ctrl_out
Emanuel Peter
duke at openjdk.java.net
Wed Feb 16 16:23:11 UTC 2022
On Mon, 14 Feb 2022 14:58:11 GMT, Emanuel Peter <duke at openjdk.java.net> wrote:
> unique_ctrl_out was used in contexts where NULL may be a valid return, and is also used in contexts where NULL is not expected.
>
> I improved the code by having two functions instead:
> unique_ctrl_out_or_null: return the unique control out, or NULL if there is no or more than one control out.
> unique_ctrl_out: return the unique control out, assert if there is no or more than one control out.
>
> This makes implicit assumptions explicit and also validates them in the future.
>
> I changed the usage to unique_ctrl_out_or_null where NULL is among the expected return values.
>
> Ran tests to verify that the assert never triggers.
This pull request has now been integrated.
Changeset: 395bc141
Author: Emanuel Peter <emanuel.peter at oracle.com>
Committer: Christian Hagedorn <chagedorn at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/395bc141f22f59aea4f5b8ee7bca0f691b2c8733
Stats: 30 lines in 8 files changed: 10 ins; 0 del; 20 mod
8281732: add assert for non-NULL assumption for return of unique_ctrl_out
Reviewed-by: kvn, chagedorn, thartmann
-------------
PR: https://git.openjdk.java.net/jdk/pull/7462
More information about the hotspot-compiler-dev
mailing list