MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / kill

Method kill

chapter06/src/main/java/com/seaofnodes/simple/node/Node.java:218–223  ·  view source on GitHub ↗

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. This function is co-recursive with #popN.

( )

Source from the content-addressed store, hash-verified

216 * code elimination. This function is co-recursive with {@link #popN}.
217 */
218 public void kill( ) {
219 assert isUnused(); // Has no uses, so it is dead
220 popN(nIns()); // Set all inputs to null, recursively killing unused Nodes
221 _type=null; // Flag as dead
222 assert isDead(); // Really dead now
223 }
224
225 // Mostly used for asserts and printing.
226 boolean isDead() { return isUnused() && nIns()==0 && _type==null; }

Callers 5

setDefMethod · 0.95
delDefMethod · 0.95
popNMethod · 0.95
deadCodeElimMethod · 0.95
mergeScopesMethod · 0.45

Calls 4

isUnusedMethod · 0.95
popNMethod · 0.95
nInsMethod · 0.95
isDeadMethod · 0.95

Tested by

no test coverage detected