Skip to content
Snippets Groups Projects
Commit d89b4704 authored by Jan de Mooij's avatar Jan de Mooij
Browse files

Bug 1761755 part 3 - Remove unnecessary IfEmitter in OptionalEmitter::emitJumpShortCircuit. r=arai

Depends on D142205

Differential Revision: https://phabricator.services.mozilla.com/D142206
parent a05ca5d2
No related branches found
No related tags found
No related merge requests found
......@@ -20,24 +20,15 @@ bool OptionalEmitter::emitJumpShortCircuit() {
MOZ_ASSERT(state_ == State::Start || state_ == State::ShortCircuit ||
state_ == State::ShortCircuitForCall);
MOZ_ASSERT(initialDepth_ + 1 == bce_->bytecodeSection().stackDepth());
InternalIfEmitter ifEmitter(bce_);
if (!bce_->emit1(JSOp::IsNullOrUndefined)) {
// [stack] OBJ NULL-OR-UNDEF
}
if (!ifEmitter.emitThen()) {
// [stack] OBJ
return false;
}
if (!bce_->emitJump(JSOp::Goto, &jumpShortCircuit_)) {
if (!bce_->emitJump(JSOp::JumpIfTrue, &jumpShortCircuit_)) {
// [stack] OBJ
return false;
}
if (!ifEmitter.emitEnd()) {
return false;
}
#ifdef DEBUG
state_ = State::ShortCircuit;
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment