LibJS: Emit GetById instead of GetByValue when key is string literal

Basically convert o["foo"] into o.foo when emitting bytecode. These are
effectively the same thing, and the latter format opts into using an
inline cache for the property lookups.
This commit is contained in:
Andreas Kling 2025-04-03 14:18:24 +02:00 committed by Andreas Kling
commit 4426c50a18
Notes: github-actions[bot] 2025-04-03 16:48:37 +00:00
3 changed files with 33 additions and 6 deletions

View file

@ -324,6 +324,9 @@ public:
void emit_get_by_id_with_this(ScopedOperand dst, ScopedOperand base, IdentifierTableIndex, ScopedOperand this_value);
void emit_get_by_value(ScopedOperand dst, ScopedOperand base, ScopedOperand property, Optional<IdentifierTableIndex> base_identifier = {});
void emit_get_by_value_with_this(ScopedOperand dst, ScopedOperand base, ScopedOperand property, ScopedOperand this_value);
void emit_iterator_value(ScopedOperand dst, ScopedOperand result);
void emit_iterator_complete(ScopedOperand dst, ScopedOperand result);