diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp index 14d5100cc6d87..9f32d6897ee69 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp @@ -187,7 +187,7 @@ std::string SpmiDumpHelper::DumpCorInfoFlag(CorInfoFlag flags) AddFlag(CORINFO_FLG_CUSTOMLAYOUT); AddFlag(CORINFO_FLG_CONTAINS_GC_PTR); AddFlag(CORINFO_FLG_DELEGATE); - AddFlag(CORINFO_FLG_CONTAINS_STACK_PTR); + AddFlag(CORINFO_FLG_BYREF_LIKE); AddFlag(CORINFO_FLG_VARIANCE); AddFlag(CORINFO_FLG_BEFOREFIELDINIT); AddFlag(CORINFO_FLG_GENERIC_TYPE_VARIABLE); diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index b779d795a16b9..0003a9f75c814 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -811,7 +811,7 @@ enum CorInfoFlag CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ? CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ? // CORINFO_FLG_UNUSED = 0x04000000, - CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it + CORINFO_FLG_BYREF_LIKE = 0x08000000, // it is byref-like value type CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able) CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags) CORINFO_FLG_GENERIC_TYPE_VARIABLE = 0x40000000, // This is really a handle for a variable type diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 3f509e79245dc..2f2189391c385 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -1733,7 +1733,7 @@ var_types Compiler::impNormStructType(CORINFO_CLASS_HANDLE structHnd, CorInfoTyp const DWORD structFlags = info.compCompHnd->getClassAttribs(structHnd); // Don't bother if the struct contains GC references of byrefs, it can't be a SIMD type. - if ((structFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) == 0) + if ((structFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) == 0) { unsigned originalSize = info.compCompHnd->getClassSize(structHnd); @@ -5876,7 +5876,7 @@ bool Compiler::verIsByRefLike(const typeInfo& ti) { return false; } - return info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_CONTAINS_STACK_PTR; + return info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_BYREF_LIKE; } bool Compiler::verIsSafeToReturnByRef(const typeInfo& ti) @@ -5897,7 +5897,7 @@ bool Compiler::verIsBoxable(const typeInfo& ti) || ti.IsUnboxedGenericTypeVar() || (ti.IsType(TI_STRUCT) && // exclude byreflike structs - !(info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_CONTAINS_STACK_PTR))); + !(info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_BYREF_LIKE))); } // Is it a boxed value type? @@ -14698,7 +14698,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) info.compCompHnd->getChildType(resolvedToken.hClass, &elemTypeHnd); assert(!(elemTypeHnd == nullptr && corType == CORINFO_TYPE_VALUECLASS)); Verify(elemTypeHnd == nullptr || - !(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_CONTAINS_STACK_PTR), + !(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_BYREF_LIKE), "newarr of byref-like objects"); verVerifyCall(opcode, &resolvedToken, nullptr, ((prefixFlags & PREFIX_TAILCALL_EXPLICIT) != 0), ((prefixFlags & PREFIX_READONLY) != 0), delegateCreateStart, codeAddr - 1, @@ -15816,7 +15816,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) CORINFO_CLASS_HANDLE elemTypeHnd; info.compCompHnd->getChildType(resolvedToken.hClass, &elemTypeHnd); Verify(elemTypeHnd == nullptr || - !(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_CONTAINS_STACK_PTR), + !(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_BYREF_LIKE), "array of byref-like type"); } diff --git a/src/coreclr/jit/layout.cpp b/src/coreclr/jit/layout.cpp index cbcb631185d9d..806ba894a33a5 100644 --- a/src/coreclr/jit/layout.cpp +++ b/src/coreclr/jit/layout.cpp @@ -370,7 +370,7 @@ void ClassLayout::InitializeGCPtrs(Compiler* compiler) unsigned gcPtrCount = compiler->info.compCompHnd->getClassGClayout(m_classHandle, gcPtrs); assert((gcPtrCount == 0) || ((compiler->info.compCompHnd->getClassAttribs(m_classHandle) & - (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) != 0)); + (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) != 0)); // Since class size is unsigned there's no way we could have more than 2^30 slots // so it should be safe to fit this into a 30 bits bit field. diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index 070dc76486ad7..2f0037464b97f 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -1835,9 +1835,9 @@ bool Compiler::StructPromotionHelper::CanPromoteStructType(CORINFO_CLASS_HANDLE } // If we saw any GC pointer or by-ref fields above then CORINFO_FLG_CONTAINS_GC_PTR or - // CORINFO_FLG_CONTAINS_STACK_PTR has to be set! + // CORINFO_FLG_BYREF_LIKE has to be set! noway_assert((containsGCpointers == false) || - ((typeFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) != 0)); + ((typeFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) != 0)); // If we have "Custom Layout" then we might have an explicit Size attribute // Managed C++ uses this for its structs, such C++ types will not contain GC pointers. diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 63154635944b2..4bffcc181daab 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -1931,7 +1931,7 @@ private uint getClassAttribsInternal(TypeDesc type) result |= CorInfoFlag.CORINFO_FLG_VALUECLASS; if (metadataType.IsByRefLike) - result |= CorInfoFlag.CORINFO_FLG_CONTAINS_STACK_PTR; + result |= CorInfoFlag.CORINFO_FLG_BYREF_LIKE; // The CLR has more complicated rules around CUSTOMLAYOUT, but this will do. if (metadataType.IsExplicitLayout || (metadataType.IsSequentialLayout && metadataType.GetClassLayout().Size != 0) || metadataType.IsWellKnownType(WellKnownType.TypedReference)) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs index 4ace5372053a7..d741ea823c51a 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs @@ -618,7 +618,7 @@ public enum CorInfoFlag : uint CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ? CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ? // CORINFO_FLG_UNUSED = 0x04000000, - CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it + CORINFO_FLG_BYREF_LIKE = 0x08000000, // it is byref-like value type CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able) CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags) CORINFO_FLG_GENERIC_TYPE_VARIABLE = 0x40000000, // This is really a handle for a variable type diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index a1307a61f5f46..1ab45790b833e 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -3689,7 +3689,7 @@ uint32_t CEEInfo::getClassAttribsInternal (CORINFO_CLASS_HANDLE clsHnd) ret |= CORINFO_FLG_VALUECLASS; if (pMT->IsByRefLike()) - ret |= CORINFO_FLG_CONTAINS_STACK_PTR; + ret |= CORINFO_FLG_BYREF_LIKE; if ((pClass->IsNotTightlyPacked() && (!pClass->IsManagedSequential() || pClass->HasExplicitSize())) || pMT == g_TypedReferenceMT ||