|
|
@@ -2624,7 +2624,7 @@ GlobOpt::OptInstr(IR::Instr *&instr, bool* isInstrRemoved)
|
|
|
!(instr->IsJitProfilingInstr()) &&
|
|
|
this->currentBlock->loop && !IsLoopPrePass() &&
|
|
|
!func->IsJitInDebugMode() &&
|
|
|
- (func->HasProfileInfo() && !func->GetReadOnlyProfileInfo()->IsMemOpDisabled()) &&
|
|
|
+ !func->IsMemOpDisabled() &&
|
|
|
this->currentBlock->loop->doMemOp)
|
|
|
{
|
|
|
CollectMemOpInfo(instrPrev, instr, src1Val, src2Val);
|
|
|
@@ -16686,7 +16686,14 @@ GlobOpt::GenerateInductionVariableChangeForMemOp(Loop *loop, byte unroll, IR::In
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- uint size = (loopCount->LoopCountMinusOneConstantValue() + 1) * unroll;
|
|
|
+ int32 loopCountMinusOnePlusOne;
|
|
|
+ int32 size;
|
|
|
+ if (Int32Math::Add(loopCount->LoopCountMinusOneConstantValue(), 1, &loopCountMinusOnePlusOne) ||
|
|
|
+ Int32Math::Mul(loopCountMinusOnePlusOne, unroll, &size))
|
|
|
+ {
|
|
|
+ throw Js::RejitException(RejitReason::MemOpDisabled);
|
|
|
+ }
|
|
|
+ Assert(size > 0);
|
|
|
sizeOpnd = IR::IntConstOpnd::New(size, IRType::TyUint32, localFunc);
|
|
|
}
|
|
|
loop->memOpInfo->inductionVariableOpndPerUnrollMap->Add(unroll, sizeOpnd);
|