LibJS: Replace SetLocal instruction usage with Mov

No need for separate instuction to set a local.
This commit is contained in:
Aliaksandr Kalenik
2024-05-14 04:40:47 +02:00
committed by Andreas Kling
parent 46ee2b5f06
commit caffd485b8
4 changed files with 1 additions and 48 deletions

View File

@@ -814,7 +814,7 @@ void Generator::emit_set_variable(JS::Identifier const& identifier, ScopedOperan
// Moving a local to itself is a no-op.
return;
}
emit<Bytecode::Op::SetLocal>(identifier.local_variable_index(), value);
emit<Bytecode::Op::Mov>(local(identifier.local_variable_index()), value);
} else {
emit<Bytecode::Op::SetVariable>(intern_identifier(identifier.string()), value, initialization_mode, mode);
}