From d17bce2d3404af1ac0125bfeca0bacc0ee6bccaa Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Mon, 16 Oct 2017 19:46:37 -0700 Subject: move ReplaceWith to cpp to make DEBUG_DESTROY_NODE visible. --- src/jit/compiler.hpp | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'src/jit/compiler.hpp') diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp index 7263718388..4007b4aaaa 100644 --- a/src/jit/compiler.hpp +++ b/src/jit/compiler.hpp @@ -1456,45 +1456,6 @@ inline void GenTree::SetOper(genTreeOps oper, ValueNumberUpdate vnUpdate) } } -//------------------------------------------------------------------------ -// 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); -- cgit v1.2.3