@@ -10438,15 +10438,25 @@ void Emit(ParseNode *pnode, ByteCodeGenerator *byteCodeGenerator, FuncInfo *func
1043810438 if (pnode->isUsed || fReturnValue )
1043910439 {
1044010440 byteCodeGenerator->StartStatement (pnode);
10441- const Js::OpCode op = (pnode->nop == knopDecPost) ? Js::OpCode::Sub_A : Js::OpCode::Add_A;
10441+ bool isESBigIntEnabled = byteCodeGenerator->GetScriptContext ()->GetConfig ()->IsESBigIntEnabled ();
10442+ Js::OpCode op1;
10443+ if (isESBigIntEnabled)
10444+ {
10445+ op1 = (pnode->nop == knopDecPost) ? Js::OpCode::Decr_Num_A : Js::OpCode::Incr_Num_A;
10446+ }
10447+ else
10448+ {
10449+ op1 = (pnode->nop == knopDecPost) ? Js::OpCode::Sub_A : Js::OpCode::Add_A;
10450+ }
1044210451 ParseNode* pnode1 = pnode->AsParseNodeUni ()->pnode1 ;
1044310452
1044410453 // Grab a register for the expression result.
1044510454 funcInfo->AcquireLoc (pnode);
1044610455
1044710456 // Load the initial value, convert it (this is the expression result), and increment it.
1044810457 EmitLoad (pnode1, byteCodeGenerator, funcInfo);
10449- byteCodeGenerator->Writer ()->Reg2 (Js::OpCode::Conv_Num, pnode->location , pnode1->location );
10458+ const Js::OpCode op2 = isESBigIntEnabled ? Js::OpCode::Conv_Numeric : Js::OpCode::Conv_Num;
10459+ byteCodeGenerator->Writer ()->Reg2 (op2, pnode->location , pnode1->location );
1045010460
1045110461 // Use temporary register if lhs cannot be assigned
1045210462 Js::RegSlot incDecResult = pnode1->location ;
@@ -10455,10 +10465,17 @@ void Emit(ParseNode *pnode, ByteCodeGenerator *byteCodeGenerator, FuncInfo *func
1045510465 {
1045610466 incDecResult = funcInfo->AcquireTmpRegister ();
1045710467 }
10458-
10459- Js::RegSlot oneReg = funcInfo->constantToRegister .LookupWithKey (1 , Js::Constants::NoRegister);
10460- Assert (oneReg != Js::Constants::NoRegister);
10461- byteCodeGenerator->Writer ()->Reg3 (op, incDecResult, pnode->location , oneReg);
10468+
10469+ if (isESBigIntEnabled)
10470+ {
10471+ byteCodeGenerator->Writer ()->Reg2 (op1, incDecResult, pnode->location );
10472+ }
10473+ else
10474+ {
10475+ Js::RegSlot oneReg = funcInfo->constantToRegister .LookupWithKey (1 , Js::Constants::NoRegister);
10476+ Assert (oneReg != Js::Constants::NoRegister);
10477+ byteCodeGenerator->Writer ()->Reg3 (op1, incDecResult, pnode->location , oneReg);
10478+ }
1046210479
1046310480 // Store the incremented value.
1046410481 EmitAssignment (nullptr , pnode1, incDecResult, byteCodeGenerator, funcInfo);
0 commit comments