summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2019-06-05 11:52:47 -0700
committerGitHub <noreply@github.com>2019-06-05 11:52:47 -0700
commitd7e49efa6b41afb2b7a9ee3adc8f0850b968562a (patch)
treec7a534aa702faf1b188d6fe54f1cab98f3efbdd4
parent5593c816a36784373cddeee748bd7d67e40bd611 (diff)
downloadcoreclr-d7e49efa6b41afb2b7a9ee3adc8f0850b968562a.tar.gz
coreclr-d7e49efa6b41afb2b7a9ee3adc8f0850b968562a.tar.bz2
coreclr-d7e49efa6b41afb2b7a9ee3adc8f0850b968562a.zip
Small fixes around AST nodes. (#24957)
* Fix MEASURE_NODE_SIZE and naming mistakes. * The additional fields were deleted in #14582 (~1.5 years ago). * Fix GT_INDEX_ADDR def. We created them as `new (this, GT_INDEX_ADDR) GenTreeIndexAddr` but used smaller `GenTreeIndex` as nessecary size. * Use LargeOpOpcode instead of GT_CALL.
-rw-r--r--src/jit/compiler.hpp2
-rw-r--r--src/jit/gentree.cpp7
-rw-r--r--src/jit/gentree.h3
-rw-r--r--src/jit/gtlist.h6
-rw-r--r--src/jit/jitstd/type_traits.h2
-rw-r--r--src/jit/jitstd/vector.h2
6 files changed, 11 insertions, 11 deletions
diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp
index 3fbf5de31d..0d80921e23 100644
--- a/src/jit/compiler.hpp
+++ b/src/jit/compiler.hpp
@@ -1443,7 +1443,7 @@ inline void GenTree::ChangeOperConst(genTreeOps oper)
inline void GenTree::ChangeOper(genTreeOps oper, ValueNumberUpdate vnUpdate)
{
- assert(!OperIsConst(oper)); // use ChangeOperLeaf() instead
+ assert(!OperIsConst(oper)); // use ChangeOperConst() instead
unsigned mask = GTF_COMMON_MASK;
if (this->OperIsIndirOrArrLength() && OperIsIndirOrArrLength(oper))
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp
index 413db06c05..a6bbf8152b 100644
--- a/src/jit/gentree.cpp
+++ b/src/jit/gentree.cpp
@@ -245,7 +245,7 @@ void GenTree::InitNodeSize()
GenTree::s_gtNodeSizes[GT_FTN_ADDR] = TREE_NODE_SZ_LARGE;
GenTree::s_gtNodeSizes[GT_BOX] = TREE_NODE_SZ_LARGE;
GenTree::s_gtNodeSizes[GT_INDEX] = TREE_NODE_SZ_LARGE;
- GenTree::s_gtNodeSizes[GT_INDEX_ADDR] = TREE_NODE_SZ_LARGE;
+ GenTree::s_gtNodeSizes[GT_INDEX_ADDR] = TREE_NODE_SZ_LARGE;
GenTree::s_gtNodeSizes[GT_ARR_BOUNDS_CHECK] = TREE_NODE_SZ_LARGE;
#ifdef FEATURE_SIMD
GenTree::s_gtNodeSizes[GT_SIMD_CHK] = TREE_NODE_SZ_LARGE;
@@ -317,6 +317,7 @@ void GenTree::InitNodeSize()
static_assert_no_msg(sizeof(GenTreeQmark) <= TREE_NODE_SZ_LARGE); // *** large node
static_assert_no_msg(sizeof(GenTreeIntrinsic) <= TREE_NODE_SZ_LARGE); // *** large node
static_assert_no_msg(sizeof(GenTreeIndex) <= TREE_NODE_SZ_LARGE); // *** large node
+ static_assert_no_msg(sizeof(GenTreeIndexAddr) <= TREE_NODE_SZ_LARGE); // *** large node
static_assert_no_msg(sizeof(GenTreeArrLen) <= TREE_NODE_SZ_LARGE); // *** large node
static_assert_no_msg(sizeof(GenTreeBoundsChk) <= TREE_NODE_SZ_LARGE); // *** large node
static_assert_no_msg(sizeof(GenTreeArrElem) <= TREE_NODE_SZ_LARGE); // *** large node
@@ -5937,8 +5938,8 @@ GenTree* Compiler::gtNewLclLNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSE
(lvaIsImplicitByRefLocal(lnum) && fgGlobalMorph && (lvaTable[lnum].lvType == TYP_BYREF)));
}
// This local variable node may later get transformed into a large node
- assert(GenTree::s_gtNodeSizes[GT_CALL] > GenTree::s_gtNodeSizes[GT_LCL_VAR]);
- GenTree* node = new (this, GT_CALL) GenTreeLclVar(type, lnum DEBUGARG(ILoffs) DEBUGARG(/*largeNode*/ true));
+ assert(GenTree::s_gtNodeSizes[LargeOpOpcode()] > GenTree::s_gtNodeSizes[GT_LCL_VAR]);
+ GenTree* node = new (this, LargeOpOpcode()) GenTreeLclVar(type, lnum DEBUGARG(ILoffs) DEBUGARG(/*largeNode*/ true));
return node;
}
diff --git a/src/jit/gentree.h b/src/jit/gentree.h
index b294748b67..c52fc9694e 100644
--- a/src/jit/gentree.h
+++ b/src/jit/gentree.h
@@ -6519,8 +6519,7 @@ inline bool GenTree::isUsedFromSpillTemp() const
/*****************************************************************************/
-// In debug, on some platforms (e.g., when LATE_DISASM is defined), GenTreeIntCon is bigger than GenTreeLclFld.
-const size_t TREE_NODE_SZ_SMALL = max(sizeof(GenTreeIntCon), sizeof(GenTreeLclFld));
+const size_t TREE_NODE_SZ_SMALL = sizeof(GenTreeLclFld);
const size_t TREE_NODE_SZ_LARGE = sizeof(GenTreeCall);
enum varRefKinds
diff --git a/src/jit/gtlist.h b/src/jit/gtlist.h
index c46bfefd72..48a585514f 100644
--- a/src/jit/gtlist.h
+++ b/src/jit/gtlist.h
@@ -155,8 +155,8 @@ GTNODE(QMARK , GenTreeQmark ,0,(GTK_BINOP|GTK_EXOP|GTK_NOTLIR))
GTNODE(COLON , GenTreeColon ,0,(GTK_BINOP|GTK_NOTLIR))
GTNODE(INDEX , GenTreeIndex ,0,(GTK_BINOP|GTK_EXOP|GTK_NOTLIR)) // SZ-array-element
-GTNODE(INDEX_ADDR , GenTreeIndex ,0,(GTK_BINOP|GTK_EXOP)) // addr of SZ-array-element; used when
- // aiming to minimize compile times.
+GTNODE(INDEX_ADDR , GenTreeIndexAddr ,0,(GTK_BINOP|GTK_EXOP)) // addr of SZ-array-element;
+ // used when aiming to minimize compile times.
GTNODE(MKREFANY , GenTreeOp ,0,GTK_BINOP)
@@ -273,7 +273,7 @@ GTNODE(PHI_ARG , GenTreePhiArg ,0,(GTK_LEAF|GTK_LOCAL)) // phi
// Nodes used by Lower to generate a closer CPU representation of other nodes
//-----------------------------------------------------------------------------
-GTNODE(JMPTABLE , GenTreeJumpTable ,0, (GTK_LEAF|GTK_NOCONTAIN)) // Generates the jump table for switches
+GTNODE(JMPTABLE , GenTree ,0, (GTK_LEAF|GTK_NOCONTAIN)) // Generates the jump table for switches
GTNODE(SWITCH_TABLE , GenTreeOp ,0, (GTK_BINOP|GTK_NOVALUE)) // Jump Table based switch construct
//-----------------------------------------------------------------------------
diff --git a/src/jit/jitstd/type_traits.h b/src/jit/jitstd/type_traits.h
index cb438d7c07..cf690a58be 100644
--- a/src/jit/jitstd/type_traits.h
+++ b/src/jit/jitstd/type_traits.h
@@ -227,4 +227,4 @@ struct make_signed<unsigned __int64>
typedef signed __int64 type;
};
-} // namespace jit_std
+} // namespace jitstd
diff --git a/src/jit/jitstd/vector.h b/src/jit/jitstd/vector.h
index 3d57cbb304..3a33d5714c 100644
--- a/src/jit/jitstd/vector.h
+++ b/src/jit/jitstd/vector.h
@@ -255,7 +255,7 @@ private:
friend class vector;
};
-}// namespace jit_std
+}// namespace jitstd