1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

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
parent bea6e31ddc
commit 14cfc44855
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)