@@ -1212,10 +1212,10 @@ IRBuilder::BuildIndirOpnd(IR::RegOpnd *baseReg, uint32 offset, const char16 *des
1212
1212
#endif
1213
1213
1214
1214
IR::SymOpnd *
1215
- IRBuilder::BuildFieldOpnd (Js::OpCode newOpcode, Js::RegSlot reg, Js::PropertyId propertyId, Js::PropertyIdIndexType propertyIdIndex, PropertyKind propertyKind, uint inlineCacheIndex)
1215
+ IRBuilder::BuildFieldOpnd (Js::OpCode newOpcode, Js::RegSlot reg, Js::PropertyId propertyId, Js::PropertyIdIndexType propertyIdIndex, PropertyKind propertyKind, uint inlineCacheIndex, bool stableSlotSym )
1216
1216
{
1217
1217
AssertOrFailFast (inlineCacheIndex < m_func->GetJITFunctionBody ()->GetInlineCacheCount () || inlineCacheIndex == Js::Constants::NoInlineCacheIndex);
1218
- PropertySym * propertySym = BuildFieldSym (reg, propertyId, propertyIdIndex, inlineCacheIndex, propertyKind);
1218
+ PropertySym * propertySym = BuildFieldSym (reg, propertyId, propertyIdIndex, inlineCacheIndex, propertyKind, stableSlotSym );
1219
1219
IR::SymOpnd * symOpnd;
1220
1220
1221
1221
// If we plan to apply object type optimization to this instruction or if we intend to emit a fast path using an inline
@@ -1243,14 +1243,14 @@ IRBuilder::BuildFieldOpnd(Js::OpCode newOpcode, Js::RegSlot reg, Js::PropertyId
1243
1243
}
1244
1244
1245
1245
PropertySym *
1246
- IRBuilder::BuildFieldSym (Js::RegSlot reg, Js::PropertyId propertyId, Js::PropertyIdIndexType propertyIdIndex, uint inlineCacheIndex, PropertyKind propertyKind)
1246
+ IRBuilder::BuildFieldSym (Js::RegSlot reg, Js::PropertyId propertyId, Js::PropertyIdIndexType propertyIdIndex, uint inlineCacheIndex, PropertyKind propertyKind, bool stableSlotSym )
1247
1247
{
1248
1248
PropertySym * propertySym;
1249
1249
SymID symId = this ->BuildSrcStackSymID (reg);
1250
1250
1251
1251
AssertMsg (m_func->m_symTable ->FindStackSym (symId), " Tried to use an undefined stacksym?" );
1252
1252
1253
- propertySym = PropertySym::FindOrCreate (symId, propertyId, propertyIdIndex, inlineCacheIndex, propertyKind, m_func);
1253
+ propertySym = PropertySym::FindOrCreate (symId, propertyId, propertyIdIndex, inlineCacheIndex, propertyKind, m_func, stableSlotSym );
1254
1254
1255
1255
return propertySym;
1256
1256
}
@@ -3882,6 +3882,7 @@ IRBuilder::BuildElementSlotI2(Js::OpCode newOpcode, uint32 offset, Js::RegSlot r
3882
3882
IR::Instr *instr;
3883
3883
PropertySym *fieldSym;
3884
3884
bool isLdSlotThatWasNotProfiled = false ;
3885
+ bool stableSlots = false ;
3885
3886
3886
3887
switch (newOpcode)
3887
3888
{
@@ -3916,13 +3917,18 @@ IRBuilder::BuildElementSlotI2(Js::OpCode newOpcode, uint32 offset, Js::RegSlot r
3916
3917
}
3917
3918
3918
3919
case Js::OpCode::LdEnvSlot:
3919
- case Js::OpCode::LdEnvObjSlot:
3920
3920
case Js::OpCode::StEnvSlot:
3921
3921
case Js::OpCode::StEnvSlotChkUndecl:
3922
+ stableSlots = true ;
3923
+ goto SlotsCommon;
3924
+
3925
+ case Js::OpCode::LdEnvObjSlot:
3922
3926
case Js::OpCode::StEnvObjSlot:
3923
3927
case Js::OpCode::StEnvObjSlotChkUndecl:
3928
+ stableSlots = false ;
3924
3929
3925
- fieldOpnd = this ->BuildFieldOpnd (Js::OpCode::LdSlotArr, this ->GetEnvReg (), slotId1, (Js::PropertyIdIndexType)-1 , PropertyKindSlotArray);
3930
+ SlotsCommon:
3931
+ fieldOpnd = this ->BuildFieldOpnd (Js::OpCode::LdSlotArr, this ->GetEnvReg (), slotId1, (Js::PropertyIdIndexType)-1 , PropertyKindSlotArray, (uint )-1 , stableSlots);
3926
3932
regOpnd = IR::RegOpnd::New (TyVar, m_func);
3927
3933
instr = IR::Instr::New (Js::OpCode::LdSlotArr, regOpnd, fieldOpnd, m_func);
3928
3934
this ->AddInstr (instr, offset);
0 commit comments