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

Method addDep

chapter19/src/main/java/com/seaofnodes/simple/node/Node.java:476–487  ·  view source on GitHub ↗

Add a node to the list of dependencies. Only add it if its not an input or output of this node, that is, it is at least one step away. The node being added must benefit from this node being peepholed.

( Node dep )

Source from the content-addressed store, hash-verified

474 * being added must benefit from this node being peepholed.
475 */
476 Node addDep( Node dep ) {
477 // Running peepholes during the big assert cannot have side effects
478 // like adding dependencies.
479 if( CODE._midAssert ) return this;
480 if( dep == null ) return this;
481 if( _deps==null ) _deps = new Ary<>(Node.class);
482 if( _deps .find(dep) != -1 ) return this; // Already on list
483 if( _inputs .find(dep) != -1 ) return this; // No need for deps on immediate neighbors
484 if( _outputs.find(dep) != -1 ) return this;
485 _deps.add(dep);
486 return this;
487 }
488
489 // Move the dependents onto a worklist, and clear for future dependents.
490 public void moveDepsToWorklist( ) {

Callers 15

idealizeMethod · 0.95
profitMethod · 0.95
computeMethod · 0.45
computeMethod · 0.45
idealizeMethod · 0.45
singleUniqueInputMethod · 0.45
allConsMethod · 0.45
checkOnlyUseMethod · 0.45
allConsMethod · 0.45
_idomMethod · 0.45
idealizeMethod · 0.45
idealizeMethod · 0.45

Calls 2

findMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected