@@ -7812,57 +7812,6 @@ GenTreeOp* Compiler::gtNewAssignNode(GenTree* dst, GenTree* src)
78127812 return asg;
78137813}
78147814
7815- //------------------------------------------------------------------------
7816- // gtNewObjNode: Creates a new BLK node with the given layout.
7817- //
7818- // Arguments:
7819- // layout - The struct layout
7820- // addr - The address of the struct
7821- //
7822- // Return Value:
7823- // Returns a node representing the struct value at the given address.
7824- //
7825- GenTreeBlk* Compiler::gtNewObjNode(ClassLayout* layout, GenTree* addr)
7826- {
7827- assert(layout != nullptr);
7828-
7829- GenTreeBlk* objNode = new (this, GT_BLK) GenTreeBlk(GT_BLK, layout->GetType(), addr, layout);
7830-
7831- // TODO-Bug: this method does not have enough information to make this determination.
7832- // The local may end up (or already is) address-exposed.
7833- if (addr->OperIs(GT_LCL_ADDR))
7834- {
7835- if (lvaIsImplicitByRefLocal(addr->AsLclVarCommon()->GetLclNum()))
7836- {
7837- objNode->gtFlags |= GTF_GLOB_REF;
7838- }
7839- }
7840- else
7841- {
7842- objNode->gtFlags |= GTF_GLOB_REF;
7843- }
7844-
7845- return objNode;
7846- }
7847-
7848- //------------------------------------------------------------------------
7849- // gtNewObjNode: Creates a new BLK node with the layout for the given handle.
7850- //
7851- // Arguments:
7852- // structHnd - The class handle of the struct type
7853- // addr - The address of the struct
7854- //
7855- // Return Value:
7856- // Returns a node representing the struct value at the given address.
7857- //
7858- GenTreeBlk* Compiler::gtNewObjNode(CORINFO_CLASS_HANDLE structHnd, GenTree* addr)
7859- {
7860- ClassLayout* layout = typGetObjLayout(structHnd);
7861- GenTreeBlk* objNode = gtNewObjNode(layout, addr);
7862-
7863- return objNode;
7864- }
7865-
78667815//------------------------------------------------------------------------
78677816// gtNewStructVal: Return a node that represents a struct or block value
78687817//
@@ -7879,8 +7828,7 @@ GenTree* Compiler::gtNewStructVal(ClassLayout* layout, GenTree* addr, GenTreeFla
78797828{
78807829 assert((indirFlags & ~GTF_IND_FLAGS) == 0);
78817830
7882- bool isVolatile = (indirFlags & GTF_IND_VOLATILE) != 0;
7883- if (!isVolatile && addr->IsLclVarAddr())
7831+ if (((indirFlags & GTF_IND_VOLATILE) == 0) && addr->IsLclVarAddr())
78847832 {
78857833 unsigned lclNum = addr->AsLclFld()->GetLclNum();
78867834 LclVarDsc* varDsc = lvaGetDesc(lclNum);
@@ -7891,24 +7839,7 @@ GenTree* Compiler::gtNewStructVal(ClassLayout* layout, GenTree* addr, GenTreeFla
78917839 }
78927840 }
78937841
7894- GenTreeBlk* blkNode;
7895- if (layout->IsBlockLayout())
7896- {
7897- blkNode = new (this, GT_BLK) GenTreeBlk(GT_BLK, layout->GetType(), addr, layout);
7898- }
7899- else
7900- {
7901- blkNode = gtNewObjNode(layout, addr);
7902- }
7903-
7904- blkNode->gtFlags |= indirFlags;
7905- if (isVolatile)
7906- {
7907- blkNode->gtFlags |= GTF_ORDER_SIDEEFF;
7908- }
7909- blkNode->SetIndirExceptionFlags(this);
7910-
7911- return blkNode;
7842+ return gtNewBlkIndir(layout, addr, indirFlags);
79127843}
79137844
79147845//------------------------------------------------------------------------
@@ -15981,7 +15912,7 @@ GenTree* Compiler::gtNewRefCOMfield(GenTree* objPtr,
1598115912 {
1598215913 if (varTypeIsStruct(lclTyp))
1598315914 {
15984- result = gtNewObjNode( structType, result);
15915+ result = gtNewBlkIndir(typGetObjLayout( structType) , result);
1598515916 }
1598615917 else
1598715918 {
0 commit comments