// Increments the number of node's parents that will evaluate the node
// through the Node<T>::CodeGen() method. The node will be evaluated
// only once, but the result will also be stored in cache with a
// matching number of references. The cache will be released once all
// parents evaluate the node.
// IMPORTANT: Currently, there's an assumption that if a node is created,
// it must be placed inside the tree. TODO: Remove this assumption and
// allow for optimizing away unused nodes.
void IncrementParentCount();
Fix: maintain count of nodes created and count of nodes in tree. Assert fail if they don't match.
Note that not fixing this will only cause more code to get generated than is necessary. In our first pass, if we have an orphan root with children, code will get generated that can't be reached through any reasonable means.
inc/NativeJIT/Nodes/Node.h
Fix: maintain count of nodes created and count of nodes in tree. Assert fail if they don't match.
Note that not fixing this will only cause more code to get generated than is necessary. In our first pass, if we have an orphan root with children, code will get generated that can't be reached through any reasonable means.