LibJS: Split PutBy* instructions into specialized per-kind variants

This allows the compiler to fold away lots of unused code for each kind.

1.10x speed-up on MicroBench/pic-add-own.js :^)
This commit is contained in:
Andreas Kling 2025-10-10 12:09:34 +02:00 committed by Andreas Kling
commit b47f8f94fe
Notes: github-actions[bot] 2025-10-11 18:10:13 +00:00
5 changed files with 439 additions and 305 deletions

View file

@ -653,7 +653,7 @@ Bytecode::CodeGenerationErrorOr<Optional<ScopedOperand>> AssignmentExpression::g
if (!lhs_is_super_expression)
generator.emit_put_by_id(*base, identifier_table_ref, rval, Bytecode::PutKind::Normal, generator.next_property_lookup_cache(), move(base_identifier));
else
generator.emit<Bytecode::Op::PutByIdWithThis>(*base, *this_value, identifier_table_ref, rval, Bytecode::PutKind::Normal, generator.next_property_lookup_cache());
generator.emit<Bytecode::Op::PutNormalByIdWithThis>(*base, *this_value, identifier_table_ref, rval, generator.next_property_lookup_cache());
} else if (expression.property().is_private_identifier()) {
auto identifier_table_ref = generator.intern_identifier(as<PrivateIdentifier>(expression.property()).string());
generator.emit<Bytecode::Op::PutPrivateById>(*base, identifier_table_ref, rval);