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

LibJS: Add Sub bytecode instruction (subtract values)

This commit is contained in:
Andreas Kling 2021-06-03 18:32:33 +02:00
parent 23a4448862
commit 2b9fbd10ed
3 changed files with 35 additions and 3 deletions

View file

@ -50,6 +50,25 @@ private:
Register m_src2;
};
class Sub final : public Instruction {
public:
Sub(Register dst, Register src1, Register src2)
: m_dst(dst)
, m_src1(src1)
, m_src2(src2)
{
}
virtual ~Sub() override { }
virtual void execute(Bytecode::Interpreter&) const override;
virtual String to_string() const override;
private:
Register m_dst;
Register m_src1;
Register m_src2;
};
class NewString final : public Instruction {
public:
NewString(Register dst, String string)