@@ -2047,8 +2047,8 @@ BackwardPass::ProcessBailOutInfo(IR::Instr * instr)
20472047bool
20482048BackwardPass::IsImplicitCallBailOutCurrentlyNeeded (IR::Instr * instr, bool mayNeedImplicitCallBailOut, bool hasLiveFields)
20492049{
2050- return this ->globOpt ->IsImplicitCallBailOutCurrentlyNeeded (
2051- instr, nullptr , nullptr , this ->currentBlock , hasLiveFields, mayNeedImplicitCallBailOut, false );
2050+ return this ->globOpt ->IsImplicitCallBailOutCurrentlyNeeded (instr, nullptr , nullptr , this -> currentBlock , hasLiveFields, mayNeedImplicitCallBailOut, false ) ||
2051+ this ->NeedBailOutOnImplicitCallsForTypedArrayStore (instr );
20522052}
20532053
20542054void
@@ -2235,6 +2235,30 @@ BackwardPass::DeadStoreImplicitCallBailOut(IR::Instr * instr, bool hasLiveFields
22352235 }
22362236}
22372237
2238+ bool
2239+ BackwardPass::NeedBailOutOnImplicitCallsForTypedArrayStore (IR::Instr* instr)
2240+ {
2241+ if ((instr->m_opcode == Js::OpCode::StElemI_A || instr->m_opcode == Js::OpCode::StElemI_A_Strict) &&
2242+ instr->GetDst ()->IsIndirOpnd () &&
2243+ instr->GetDst ()->AsIndirOpnd ()->GetBaseOpnd ()->GetValueType ().IsLikelyTypedArray ())
2244+ {
2245+ IR::Opnd * opnd = instr->GetSrc1 ();
2246+ if (opnd->IsRegOpnd ())
2247+ {
2248+ return !opnd->AsRegOpnd ()->GetValueType ().IsPrimitive () &&
2249+ !opnd->AsRegOpnd ()->m_sym ->IsInt32 () &&
2250+ !opnd->AsRegOpnd ()->m_sym ->IsFloat64 () &&
2251+ !opnd->AsRegOpnd ()->m_sym ->IsFloatConst () &&
2252+ !opnd->AsRegOpnd ()->m_sym ->IsIntConst ();
2253+ }
2254+ else
2255+ {
2256+ Assert (opnd->IsIntConstOpnd () || opnd->IsInt64ConstOpnd () || opnd->IsFloat32ConstOpnd () || opnd->IsFloatConstOpnd () || opnd->IsAddrOpnd ());
2257+ }
2258+ }
2259+ return false ;
2260+ }
2261+
22382262void
22392263BackwardPass::ProcessPendingPreOpBailOutInfo (IR::Instr *const currentInstr)
22402264{
0 commit comments