summaryrefslogtreecommitdiff
path: root/src/jit/morph.cpp
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2019-04-23 10:00:42 -0700
committerBrian Sullivan <briansul@microsoft.com>2019-04-23 10:00:42 -0700
commitdbf2f74ded4310025d0ce6d74d137ed2bc64727e (patch)
tree775e0c8452a6ed0a9ae0daad79e3393b726f8c8b /src/jit/morph.cpp
parent22028dccbeb4cf80a2b6fd4df0100b0babb26382 (diff)
downloadcoreclr-dbf2f74ded4310025d0ce6d74d137ed2bc64727e.tar.gz
coreclr-dbf2f74ded4310025d0ce6d74d137ed2bc64727e.tar.bz2
coreclr-dbf2f74ded4310025d0ce6d74d137ed2bc64727e.zip
Added additional comment explaining ChnageOper(GT_LCL_FLD) and NotAField
Diffstat (limited to 'src/jit/morph.cpp')
-rw-r--r--src/jit/morph.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp
index 720dc76218..985fdb3ef7 100644
--- a/src/jit/morph.cpp
+++ b/src/jit/morph.cpp
@@ -13478,35 +13478,38 @@ DONE_MORPHING_CHILDREN:
// lclVar and must not extend beyond the end of the lclVar.
if ((ival1 >= 0) && ((ival1 + genTypeSize(typ)) <= varSize))
{
+ GenTreeLclFld* lclFld;
+
// We will turn a GT_LCL_VAR into a GT_LCL_FLD with an gtLclOffs of 'ival'
// or if we already have a GT_LCL_FLD we will adjust the gtLclOffs by adding 'ival'
// Then we change the type of the GT_LCL_FLD to match the orginal GT_IND type.
//
if (temp->OperGet() == GT_LCL_FLD)
{
- temp->AsLclFld()->gtLclOffs += (unsigned short)ival1;
- temp->AsLclFld()->gtFieldSeq =
- GetFieldSeqStore()->Append(temp->AsLclFld()->gtFieldSeq, fieldSeq);
+ lclFld = temp->AsLclFld();
+ lclFld->gtLclOffs += (unsigned short)ival1;
+ lclFld->gtFieldSeq = GetFieldSeqStore()->Append(lclFld->gtFieldSeq, fieldSeq);
}
else // we have a GT_LCL_VAR
{
assert(temp->OperGet() == GT_LCL_VAR);
- temp->ChangeOper(GT_LCL_FLD); // Note that this typically makes the gtFieldSeq "NotAField"...
- temp->AsLclFld()->gtLclOffs = (unsigned short)ival1;
+ temp->ChangeOper(GT_LCL_FLD); // Note that this typically makes the gtFieldSeq "NotAField",
+ // unless there is a zero filed offset associated with 'temp'.
+ lclFld = temp->AsLclFld();
+ lclFld->gtLclOffs = (unsigned short)ival1;
- if (temp->AsLclFld()->gtFieldSeq == FieldSeqStore::NotAField())
+ if (lclFld->gtFieldSeq == FieldSeqStore::NotAField())
{
if (fieldSeq != nullptr)
{
// If it does represent a field, note that.
- temp->AsLclFld()->gtFieldSeq = fieldSeq;
+ lclFld->gtFieldSeq = fieldSeq;
}
}
else
{
// Append 'fieldSeq' to the existing one
- temp->AsLclFld()->gtFieldSeq =
- GetFieldSeqStore()->Append(temp->AsLclFld()->gtFieldSeq, fieldSeq);
+ lclFld->gtFieldSeq = GetFieldSeqStore()->Append(lclFld->gtFieldSeq, fieldSeq);
}
}
temp->gtType = tree->gtType;