Skip to content

Commit d04e9e7

Browse files
committed
[MERGE #5211 @pleath] [MSFT 17535796] On depoloymorphication, write the slot index discovered during GlobOpt into the ObjTypeSpecFldInfo as well as the opnd field
Merge pull request #5211 from pleath:17535796 That way it will be copied into the set that supports the runtime equivalence check.
2 parents ff72e95 + ec0c738 commit d04e9e7

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

lib/Backend/GlobOptFields.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,9 @@ GlobOpt::ProcessPropOpInTypeCheckSeq(IR::Instr* instr, IR::PropertySymOpnd *opnd
11701170
opnd->SetSlotIndex(slotIndex);
11711171
opnd->SetUsesAuxSlot(auxSlot);
11721172

1173+
opnd->GetObjTypeSpecInfo()->SetSlotIndex(slotIndex);
1174+
opnd->GetObjTypeSpecInfo()->SetUsesAuxSlot(auxSlot);
1175+
11731176
isSpecialized = true;
11741177
if (isTypeCheckedOut)
11751178
{

lib/Backend/ObjTypeSpecFldInfo.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ ObjTypeSpecFldInfo::TryDepolymorphication(JITTypeHolder type, uint16 slotIndex,
7777
}
7878
}
7979

80+
void
81+
ObjTypeSpecFldInfo::SetUsesAuxSlot(bool usesAuxSlot)
82+
{
83+
ObjTypeSpecFldInfoFlags flags = GetFlags();
84+
flags.usesAuxSlot = usesAuxSlot;
85+
m_data.flags = flags.flags;
86+
}
87+
8088
bool
8189
ObjTypeSpecFldInfo::UsesAuxSlot() const
8290
{
@@ -200,6 +208,13 @@ ObjTypeSpecFldInfo::GetSlotIndex() const
200208
return m_data.slotIndex;
201209
}
202210

211+
void
212+
ObjTypeSpecFldInfo::SetSlotIndex(uint16 slotIndex)
213+
{
214+
Assert(m_data.slotIndex == Js::Constants::NoSlot || m_data.slotIndex == slotIndex);
215+
m_data.slotIndex = slotIndex;
216+
}
217+
203218
uint16
204219
ObjTypeSpecFldInfo::GetFixedFieldCount() const
205220
{

lib/Backend/ObjTypeSpecFldInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class ObjTypeSpecFldInfo
137137
m_data.polymorphicInfoArray = polymorphicInfoArray->GetRaw();
138138
}
139139

140+
void SetUsesAuxSlot(bool usesAuxSlot);
140141
bool UsesAuxSlot() const;
141142
bool UsesAccessor() const;
142143
bool IsRootObjectNonConfigurableFieldLoad() const;
@@ -199,6 +200,7 @@ class ObjTypeSpecFldInfo
199200

200201
Js::PropertyId GetPropertyId() const;
201202
uint16 GetSlotIndex() const;
203+
void SetSlotIndex(uint16 slotIndex);
202204
uint16 * GetSlotIndices() const;
203205
uint16 GetFixedFieldCount() const;
204206

0 commit comments

Comments
 (0)