LibJS: Add PutById bytecode instruction for object property assignment

Note that this is only used for non-computed accesses. Computed access
is not yet implemented. :^)
This commit is contained in:
Andreas Kling 2021-06-04 20:47:07 +02:00
commit 14cfc44855
Notes: sideshowbarker 2024-07-18 12:42:18 +09:00
3 changed files with 44 additions and 0 deletions

View file

@ -174,6 +174,25 @@ private:
FlyString m_identifier;
};
class PutById final : public Instruction {
public:
PutById(Register base, FlyString property, Register src)
: m_base(base)
, m_property(move(property))
, m_src(src)
{
}
virtual ~PutById() override { }
virtual void execute(Bytecode::Interpreter&) const override;
virtual String to_string() const override;
private:
Register m_base;
FlyString m_property;
Register m_src;
};
class Jump final : public Instruction {
public:
explicit Jump(Label target)