}
}
-//------------------------------------------------------------------------
-// ReplaceWith: replace this with the src node. The source must be an isolated node
-// and cannot be used after the replacement.
-//
-// Arguments:
-// src - source tree, that replaces this.
-// comp - the compiler instance to transfer annotations for arrays.
-//
-inline void GenTree::ReplaceWith(GenTree* src, Compiler* comp)
-{
- // The source may be big only if the target is also a big node
- assert((gtDebugFlags & GTF_DEBUG_NODE_LARGE) || GenTree::s_gtNodeSizes[src->gtOper] == TREE_NODE_SZ_SMALL);
-
- // The check is effective only if nodes have been already threaded.
- assert((src->gtPrev == nullptr) && (src->gtNext == nullptr));
-
- RecordOperBashing(OperGet(), src->OperGet()); // nop unless NODEBASH_STATS is enabled
-
- GenTreePtr prev = gtPrev;
- GenTreePtr next = gtNext;
- // The VTable pointer is copied intentionally here
- memcpy((void*)this, (void*)src, src->GetNodeSize());
- this->gtPrev = prev;
- this->gtNext = next;
-
-#ifdef DEBUG
- gtSeqNum = 0;
-#endif
- // Transfer any annotations.
- if (src->OperGet() == GT_IND && src->gtFlags & GTF_IND_ARR_INDEX)
- {
- ArrayInfo arrInfo;
- bool b = comp->GetArrayInfoMap()->Lookup(src, &arrInfo);
- assert(b);
- comp->GetArrayInfoMap()->Set(this, arrInfo);
- }
- DEBUG_DESTROY_NODE(src);
-}
-
inline GenTreePtr Compiler::gtNewCastNode(var_types typ, GenTreePtr op1, var_types castType)
{
GenTreePtr res = new (this, GT_CAST) GenTreeCast(typ, op1, castType);
}
#endif
+#if SMALL_TREE_NODES
+//------------------------------------------------------------------------
+// ReplaceWith: replace this with the src node. The source must be an isolated node
+// and cannot be used after the replacement.
+//
+// Arguments:
+// src - source tree, that replaces this.
+// comp - the compiler instance to transfer annotations for arrays.
+//
+void GenTree::ReplaceWith(GenTree* src, Compiler* comp)
+{
+ // The source may be big only if the target is also a big node
+ assert((gtDebugFlags & GTF_DEBUG_NODE_LARGE) || GenTree::s_gtNodeSizes[src->gtOper] == TREE_NODE_SZ_SMALL);
+
+ // The check is effective only if nodes have been already threaded.
+ assert((src->gtPrev == nullptr) && (src->gtNext == nullptr));
+
+ RecordOperBashing(OperGet(), src->OperGet()); // nop unless NODEBASH_STATS is enabled
+
+ GenTreePtr prev = gtPrev;
+ GenTreePtr next = gtNext;
+ // The VTable pointer is copied intentionally here
+ memcpy((void*)this, (void*)src, src->GetNodeSize());
+ this->gtPrev = prev;
+ this->gtNext = next;
+
+#ifdef DEBUG
+ gtSeqNum = 0;
+#endif
+ // Transfer any annotations.
+ if (src->OperGet() == GT_IND && src->gtFlags & GTF_IND_ARR_INDEX)
+ {
+ ArrayInfo arrInfo;
+ bool b = comp->GetArrayInfoMap()->Lookup(src, &arrInfo);
+ assert(b);
+ comp->GetArrayInfoMap()->Set(this, arrInfo);
+ }
+ DEBUG_DESTROY_NODE(src);
+}
+
+#endif
+
/*****************************************************************************
*
* When 'NODEBASH_STATS' is enabled in "jit.h" we record all instances of