Skip to content

Commit

Permalink
Delete ArrayInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
SingleAccretion committed Mar 29, 2022
1 parent ebacc52 commit 643eb9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 34 deletions.
18 changes: 0 additions & 18 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -1377,24 +1377,6 @@ class LinearScanInterface

LinearScanInterface* getLinearScanAllocator(Compiler* comp);

// Information about arrays: their element type and size, and the offset of the first element.
struct ArrayInfo
{
var_types m_elemType;
CORINFO_CLASS_HANDLE m_elemStructType;
unsigned m_elemSize;
unsigned m_elemOffset;

ArrayInfo() : m_elemType(TYP_UNDEF), m_elemStructType(nullptr), m_elemSize(0), m_elemOffset(0)
{
}

ArrayInfo(var_types elemType, unsigned elemSize, unsigned elemOffset, CORINFO_CLASS_HANDLE elemStructType)
: m_elemType(elemType), m_elemStructType(elemStructType), m_elemSize(elemSize), m_elemOffset(elemOffset)
{
}
};

// This enumeration names the phases into which we divide compilation. The phases should completely
// partition a compilation.
enum Phases
Expand Down
28 changes: 12 additions & 16 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9791,29 +9791,25 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, _In_ _In_opt_
printf("<%S, %u>", shortClassName, classSize);
}
}
else if (tree->OperIsIndir())
{
ArrayInfo arrInfo;
if (TryGetArrayInfo(tree->AsIndir(), &arrInfo))
{
if (varTypeIsStruct(arrInfo.m_elemType))
{
CORINFO_CLASS_HANDLE clsHnd = arrInfo.m_elemStructType;
// We could create a layout with `typGetObjLayout(asInd->gtStructElemClass)` but we
// don't want to affect the layout table.
const unsigned classSize = info.compCompHnd->getClassSize(clsHnd);
const char16_t* shortClassName = eeGetShortClassName(clsHnd);
printf("<%S, %u>", shortClassName, classSize);
}
}
}

if (layout != nullptr)
{
gtDispClassLayout(layout, tree->TypeGet());
}
}

if (tree->OperIs(GT_ARR_ADDR))
{
if (tree->AsArrAddr()->GetElemClassHandle() != NO_CLASS_HANDLE)
{
printf("%S[]", eeGetShortClassName(tree->AsArrAddr()->GetElemClassHandle()));
}
else
{
printf("%s[]", varTypeName(tree->AsArrAddr()->GetElemType()));
}
}

if (tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_STORE_LCL_VAR)
{
LclVarDsc* varDsc = lvaGetDesc(tree->AsLclVarCommon());
Expand Down

0 comments on commit 643eb9e

Please sign in to comment.