Skip to content

Commit f45dfdc

Browse files
authored
Rename CORINFO_FLG_CONTAINS_STACK_PTR to CORINFO_FLG_BYREF_LIKE (#61907)
The current name is causing confusion
1 parent c2b7638 commit f45dfdc

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

src/coreclr/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ std::string SpmiDumpHelper::DumpCorInfoFlag(CorInfoFlag flags)
187187
AddFlag(CORINFO_FLG_CUSTOMLAYOUT);
188188
AddFlag(CORINFO_FLG_CONTAINS_GC_PTR);
189189
AddFlag(CORINFO_FLG_DELEGATE);
190-
AddFlag(CORINFO_FLG_CONTAINS_STACK_PTR);
190+
AddFlag(CORINFO_FLG_BYREF_LIKE);
191191
AddFlag(CORINFO_FLG_VARIANCE);
192192
AddFlag(CORINFO_FLG_BEFOREFIELDINIT);
193193
AddFlag(CORINFO_FLG_GENERIC_TYPE_VARIABLE);

src/coreclr/inc/corinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ enum CorInfoFlag
811811
CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ?
812812
CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ?
813813
// CORINFO_FLG_UNUSED = 0x04000000,
814-
CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it
814+
CORINFO_FLG_BYREF_LIKE = 0x08000000, // it is byref-like value type
815815
CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able)
816816
CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags)
817817
CORINFO_FLG_GENERIC_TYPE_VARIABLE = 0x40000000, // This is really a handle for a variable type

src/coreclr/jit/importer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ var_types Compiler::impNormStructType(CORINFO_CLASS_HANDLE structHnd, CorInfoTyp
17331733
const DWORD structFlags = info.compCompHnd->getClassAttribs(structHnd);
17341734

17351735
// Don't bother if the struct contains GC references of byrefs, it can't be a SIMD type.
1736-
if ((structFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) == 0)
1736+
if ((structFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) == 0)
17371737
{
17381738
unsigned originalSize = info.compCompHnd->getClassSize(structHnd);
17391739

@@ -5876,7 +5876,7 @@ bool Compiler::verIsByRefLike(const typeInfo& ti)
58765876
{
58775877
return false;
58785878
}
5879-
return info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_CONTAINS_STACK_PTR;
5879+
return info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_BYREF_LIKE;
58805880
}
58815881

58825882
bool Compiler::verIsSafeToReturnByRef(const typeInfo& ti)
@@ -5897,7 +5897,7 @@ bool Compiler::verIsBoxable(const typeInfo& ti)
58975897
|| ti.IsUnboxedGenericTypeVar() ||
58985898
(ti.IsType(TI_STRUCT) &&
58995899
// exclude byreflike structs
5900-
!(info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_CONTAINS_STACK_PTR)));
5900+
!(info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_BYREF_LIKE)));
59015901
}
59025902

59035903
// Is it a boxed value type?
@@ -14698,7 +14698,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
1469814698
info.compCompHnd->getChildType(resolvedToken.hClass, &elemTypeHnd);
1469914699
assert(!(elemTypeHnd == nullptr && corType == CORINFO_TYPE_VALUECLASS));
1470014700
Verify(elemTypeHnd == nullptr ||
14701-
!(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_CONTAINS_STACK_PTR),
14701+
!(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_BYREF_LIKE),
1470214702
"newarr of byref-like objects");
1470314703
verVerifyCall(opcode, &resolvedToken, nullptr, ((prefixFlags & PREFIX_TAILCALL_EXPLICIT) != 0),
1470414704
((prefixFlags & PREFIX_READONLY) != 0), delegateCreateStart, codeAddr - 1,
@@ -15816,7 +15816,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
1581615816
CORINFO_CLASS_HANDLE elemTypeHnd;
1581715817
info.compCompHnd->getChildType(resolvedToken.hClass, &elemTypeHnd);
1581815818
Verify(elemTypeHnd == nullptr ||
15819-
!(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_CONTAINS_STACK_PTR),
15819+
!(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_BYREF_LIKE),
1582015820
"array of byref-like type");
1582115821
}
1582215822

src/coreclr/jit/layout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ void ClassLayout::InitializeGCPtrs(Compiler* compiler)
370370
unsigned gcPtrCount = compiler->info.compCompHnd->getClassGClayout(m_classHandle, gcPtrs);
371371

372372
assert((gcPtrCount == 0) || ((compiler->info.compCompHnd->getClassAttribs(m_classHandle) &
373-
(CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) != 0));
373+
(CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) != 0));
374374

375375
// Since class size is unsigned there's no way we could have more than 2^30 slots
376376
// so it should be safe to fit this into a 30 bits bit field.

src/coreclr/jit/lclvars.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,9 +1835,9 @@ bool Compiler::StructPromotionHelper::CanPromoteStructType(CORINFO_CLASS_HANDLE
18351835
}
18361836

18371837
// If we saw any GC pointer or by-ref fields above then CORINFO_FLG_CONTAINS_GC_PTR or
1838-
// CORINFO_FLG_CONTAINS_STACK_PTR has to be set!
1838+
// CORINFO_FLG_BYREF_LIKE has to be set!
18391839
noway_assert((containsGCpointers == false) ||
1840-
((typeFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) != 0));
1840+
((typeFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) != 0));
18411841

18421842
// If we have "Custom Layout" then we might have an explicit Size attribute
18431843
// Managed C++ uses this for its structs, such C++ types will not contain GC pointers.

src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ private uint getClassAttribsInternal(TypeDesc type)
19311931
result |= CorInfoFlag.CORINFO_FLG_VALUECLASS;
19321932

19331933
if (metadataType.IsByRefLike)
1934-
result |= CorInfoFlag.CORINFO_FLG_CONTAINS_STACK_PTR;
1934+
result |= CorInfoFlag.CORINFO_FLG_BYREF_LIKE;
19351935

19361936
// The CLR has more complicated rules around CUSTOMLAYOUT, but this will do.
19371937
if (metadataType.IsExplicitLayout || (metadataType.IsSequentialLayout && metadataType.GetClassLayout().Size != 0) || metadataType.IsWellKnownType(WellKnownType.TypedReference))

src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ public enum CorInfoFlag : uint
618618
CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ?
619619
CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ?
620620
// CORINFO_FLG_UNUSED = 0x04000000,
621-
CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it
621+
CORINFO_FLG_BYREF_LIKE = 0x08000000, // it is byref-like value type
622622
CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able)
623623
CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags)
624624
CORINFO_FLG_GENERIC_TYPE_VARIABLE = 0x40000000, // This is really a handle for a variable type

src/coreclr/vm/jitinterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3689,7 +3689,7 @@ uint32_t CEEInfo::getClassAttribsInternal (CORINFO_CLASS_HANDLE clsHnd)
36893689
ret |= CORINFO_FLG_VALUECLASS;
36903690

36913691
if (pMT->IsByRefLike())
3692-
ret |= CORINFO_FLG_CONTAINS_STACK_PTR;
3692+
ret |= CORINFO_FLG_BYREF_LIKE;
36933693

36943694
if ((pClass->IsNotTightlyPacked() && (!pClass->IsManagedSequential() || pClass->HasExplicitSize())) ||
36953695
pMT == g_TypedReferenceMT ||

0 commit comments

Comments
 (0)