LibJS: Store NewObject result directly in preferred dst if possible

This avoids a Mov after every object literal.
This commit is contained in:
Andreas Kling 2025-03-27 15:49:49 +00:00 committed by Andreas Kling
parent 900f209b34
commit 5ea45da15f
Notes: github-actions[bot] 2025-03-27 19:51:10 +00:00

View file

@ -1129,7 +1129,7 @@ Bytecode::CodeGenerationErrorOr<Optional<ScopedOperand>> ObjectExpression::gener
{
Bytecode::Generator::SourceLocationScope scope(generator, *this);
auto object = generator.allocate_register();
auto object = choose_dst(generator, preferred_dst);
generator.emit<Bytecode::Op::NewObject>(object);
if (m_properties.is_empty())