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

LibJS: Add GetById bytecode instruction for object property retrieval

Same as PutById but in the other direction. :^)
This commit is contained in:
Andreas Kling 2021-06-04 21:03:53 +02:00
parent 14cfc44855
commit 32561bb90d
4 changed files with 45 additions and 0 deletions

View file

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