@@ -2675,7 +2675,7 @@ GlobOpt::OptInstr(IR::Instr *&instr, bool* isInstrRemoved)
26752675 !(instr->IsJitProfilingInstr()) &&
26762676 this->currentBlock->loop && !IsLoopPrePass() &&
26772677 !func->IsJitInDebugMode() &&
2678- (func->HasProfileInfo() && !func->GetReadOnlyProfileInfo()-> IsMemOpDisabled() ) &&
2678+ !func->IsMemOpDisabled() &&
26792679 this->currentBlock->loop->doMemOp)
26802680 {
26812681 CollectMemOpInfo(instrPrev, instr, src1Val, src2Val);
@@ -16864,6 +16864,7 @@ GlobOpt::GenerateBailOutMarkTempObjectIfNeeded(IR::Instr * instr, IR::Opnd * opn
1686416864 if (instr->HasBailOutInfo())
1686516865 {
1686616866 instr->SetBailOutKind(instr->GetBailOutKind() | IR::BailOutMarkTempObject);
16867+ instr->GetBailOutInfo()->canDeadStore = false;
1686716868 }
1686816869 else
1686916870 {
@@ -16873,6 +16874,11 @@ GlobOpt::GenerateBailOutMarkTempObjectIfNeeded(IR::Instr * instr, IR::Opnd * opn
1687316874 || (instr->m_opcode == Js::OpCode::FromVar && !opnd->GetValueType().IsPrimitive())
1687416875 || propertySymOpnd == nullptr
1687516876 || !propertySymOpnd->IsTypeCheckProtected())
16877+ {
16878+ this->GenerateBailAtOperation(&instr, IR::BailOutMarkTempObject);
16879+ instr->GetBailOutInfo()->canDeadStore = false;
16880+ }
16881+ else if (propertySymOpnd->MayHaveImplicitCall())
1687616882 {
1687716883 this->GenerateBailAtOperation(&instr, IR::BailOutMarkTempObject);
1687816884 }
@@ -17013,7 +17019,14 @@ GlobOpt::GenerateInductionVariableChangeForMemOp(Loop *loop, byte unroll, IR::In
1701317019 }
1701417020 else
1701517021 {
17016- uint size = (loopCount->LoopCountMinusOneConstantValue() + 1) * unroll;
17022+ int32 loopCountMinusOnePlusOne;
17023+ int32 size;
17024+ if (Int32Math::Add(loopCount->LoopCountMinusOneConstantValue(), 1, &loopCountMinusOnePlusOne) ||
17025+ Int32Math::Mul(loopCountMinusOnePlusOne, unroll, &size))
17026+ {
17027+ throw Js::RejitException(RejitReason::MemOpDisabled);
17028+ }
17029+ Assert(size > 0);
1701717030 sizeOpnd = IR::IntConstOpnd::New(size, IRType::TyUint32, localFunc);
1701817031 }
1701917032 loop->memOpInfo->inductionVariableOpndPerUnrollMap->Add(unroll, sizeOpnd);
0 commit comments