Issue #2308 & #1240 Follow-up - Introduce new increment and decrement operations. https://bugzilla.mozilla.org/show_bug.cgi?id=1508521

This commit is contained in:
Brian Smith 2023-09-16 05:38:42 -05:00 committed by roytam1
commit 5c8a6c5bb8
13 changed files with 157 additions and 30 deletions

View file

@ -233,7 +233,7 @@ ElemOpEmitter::emitIncDec()
MOZ_ASSERT(state_ == State::Get);
JSOp binOp = isInc() ? JSOP_ADD : JSOP_SUB;
JSOp incOp = isInc() ? JSOP_INC : JSOP_DEC;
if (!bce_->emit1(JSOP_POS)) { // ... N
return false;
}
@ -242,10 +242,7 @@ ElemOpEmitter::emitIncDec()
return false;
}
}
if (!bce_->emit1(JSOP_ONE)) { // ... N? N 1
return false;
}
if (!bce_->emit1(binOp)) { // ... N? N+1
if (!bce_->emit1(incOp)) { // ... N? N+1
return false;
}
if (isPostIncDec()) {