RFR: 8281732: add assert for non-NULL assumption for return of unique_ctrl_out

Emanuel Peter duke at openjdk.java.net
Mon Feb 14 15:06:28 UTC 2022


…_out

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.

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

Commit messages:
 - 8281732: add assert for non-NULL assumption for return of unique_ctrl_out

Changes: https://git.openjdk.java.net/jdk/pull/7462/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7462&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281732
  Stats: 28 lines in 10 files changed: 10 ins; 0 del; 18 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7462.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7462/head:pull/7462

PR: https://git.openjdk.java.net/jdk/pull/7462


More information about the hotspot-compiler-dev mailing list