Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/coreclr/jit/compiler.hpp')
-rw-r--r--src/coreclr/jit/compiler.hpp62
1 files changed, 6 insertions, 56 deletions
diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp
index 274514bbf98..b89ebaf0871 100644
--- a/src/coreclr/jit/compiler.hpp
+++ b/src/coreclr/jit/compiler.hpp
@@ -1069,61 +1069,6 @@ inline GenTree* Compiler::gtNewRuntimeLookup(CORINFO_GENERIC_HANDLE hnd, CorInfo
return node;
}
-//------------------------------------------------------------------------
-// gtNewFieldRef: a helper for creating GT_FIELD nodes.
-//
-// Normalizes struct types (for SIMD vectors). Sets GTF_GLOB_REF for fields
-// that may be pointing into globally visible memory.
-//
-// Arguments:
-// type - type for the field node
-// fldHnd - the field handle
-// obj - the instance, an address
-// offset - the field offset
-//
-// Return Value:
-// The created node.
-//
-inline GenTreeField* Compiler::gtNewFieldRef(var_types type, CORINFO_FIELD_HANDLE fldHnd, GenTree* obj, DWORD offset)
-{
- // GT_FIELD nodes are transformed into GT_IND nodes.
- assert(GenTree::s_gtNodeSizes[GT_IND] <= GenTree::s_gtNodeSizes[GT_FIELD]);
-
- if (type == TYP_STRUCT)
- {
- CORINFO_CLASS_HANDLE structHnd;
- eeGetFieldType(fldHnd, &structHnd);
- type = impNormStructType(structHnd);
- }
-
- GenTreeField* fieldNode = new (this, GT_FIELD) GenTreeField(type, obj, fldHnd, offset);
-
- // If "obj" is the address of a local, note that a field of that struct local has been accessed.
- if ((obj != nullptr) && obj->OperIs(GT_ADDR) && varTypeIsStruct(obj->AsUnOp()->gtOp1) &&
- obj->AsUnOp()->gtOp1->OperIs(GT_LCL_VAR))
- {
- LclVarDsc* varDsc = lvaGetDesc(obj->AsUnOp()->gtOp1->AsLclVarCommon());
-
- varDsc->lvFieldAccessed = 1;
-
- if (lvaIsImplicitByRefLocal(lvaGetLclNum(varDsc)))
- {
- // These structs are passed by reference and can easily become global references if those
- // references are exposed. We clear out address-exposure information for these parameters
- // when they are converted into references in fgRetypeImplicitByRefArgs() so we do not have
- // the necessary information in morph to know if these indirections are actually global
- // references, so we have to be conservative here.
- fieldNode->gtFlags |= GTF_GLOB_REF;
- }
- }
- else
- {
- fieldNode->gtFlags |= GTF_GLOB_REF;
- }
-
- return fieldNode;
-}
-
inline GenTreeIndexAddr* Compiler::gtNewIndexAddr(GenTree* arrayOp,
GenTree* indexOp,
var_types elemType,
@@ -1267,10 +1212,14 @@ inline GenTreeMDArr* Compiler::gtNewMDArrLowerBound(GenTree* arrayOp, unsigned d
// Return Value:
// New GT_IND node
-inline GenTreeIndir* Compiler::gtNewIndir(var_types typ, GenTree* addr)
+inline GenTreeIndir* Compiler::gtNewIndir(var_types typ, GenTree* addr, GenTreeFlags indirFlags)
{
+ assert((indirFlags & ~GTF_IND_FLAGS) == GTF_EMPTY);
+
GenTree* indir = gtNewOperNode(GT_IND, typ, addr);
+ indir->gtFlags |= indirFlags;
indir->SetIndirExceptionFlags(this);
+
return indir->AsIndir();
}
@@ -4130,6 +4079,7 @@ void GenTree::VisitOperands(TVisitor visitor)
// Unary operators with an optional operand
case GT_NOP:
case GT_FIELD:
+ case GT_FIELD_ADDR:
case GT_RETURN:
case GT_RETFILT:
if (this->AsUnOp()->gtOp1 == nullptr)