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

Method addDep

chapter21/src/main/java/com/seaofnodes/simple/node/Node.java:549–559  ·  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.

( N dep )

Source from the content-addressed store, hash-verified

547 int _hash;
548
549 // If the _hash is set, then the Node is in the GVN table; remove it.
550 void unlock() {
551 if( _hash==0 ) return;
552 Node old = CODE._gvn.remove(this); // Pull from table
553 assert old==this;
554 _hash=0; // Out of table now
555 }
556
557 // Hash of opcode and inputs
558 @Override public final int hashCode() {
559 if( _hash != 0 ) return _hash;
560 int hash = hash();
561 for( Node n : _inputs )
562 if( n != null )

Callers 15

computeMethod · 0.45
idealizeMethod · 0.45
computeMethod · 0.45
idealizeMethod · 0.45
same_opMethod · 0.45
singleUniqueInputMethod · 0.45
allConsMethod · 0.45
checkOnlyUseMethod · 0.45
allConsMethod · 0.45
_idomMethod · 0.45
idealizeMethod · 0.45
hasMidUserMethod · 0.45

Calls 2

findMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected