Kill a Node with no uses , by setting all of its defs to null. This may recursively kill more Nodes, and is basically dead code elimination.
( )
| 239 | // ------------------------------------------------------------------------ |
| 240 | // Graph-based optimizations |
| 241 | |
| 242 | /** |
| 243 | * Try to peephole at this node and return a better replacement Node. |
| 244 | * Always returns some not-null Node (often this). |
| 245 | */ |
| 246 | public final Node peephole() { |
| 247 | var obs = IterPeeps.midAssert() ? null : Parser.PARSER == null ? null : Parser.PARSER._obs; |
| 248 | if( obs != null ) obs.before(this); |
| 249 | Node n = peepholeOpt(); |
| 250 | Node rez = n == null ? this : deadCodeElim(n.peephole()); |
| 251 | if( obs != null ) obs.after(this, n == null ? null : rez, false); |
| 252 | return rez; |
| 253 | } |
| 254 | |
| 255 | /** |
| 256 | * Try to peephole at this node and return a better replacement Node if |
| 257 | * possible. We compute a {@link Type} and then check and replace: |
| 258 | * <ul> |
no test coverage detected