1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

LibJS: Add bytecode ops for >, >= and <=

This commit is contained in:
Gunnar Beutner 2021-06-07 19:57:38 +02:00 committed by Andreas Kling
parent 73b8acf432
commit 4be3374b24
4 changed files with 99 additions and 0 deletions

View file

@ -146,6 +146,44 @@ private:
Register m_src2;
};
class GreaterThan final : public Instruction {
public:
GreaterThan(Register dst, Register src1, Register src2)
: Instruction(Type::GreaterThan)
, m_dst(dst)
, m_src1(src1)
, m_src2(src2)
{
}
void execute(Bytecode::Interpreter&) const;
String to_string() const;
private:
Register m_dst;
Register m_src1;
Register m_src2;
};
class GreaterThanEquals final : public Instruction {
public:
GreaterThanEquals(Register dst, Register src1, Register src2)
: Instruction(Type::GreaterThanEquals)
, m_dst(dst)
, m_src1(src1)
, m_src2(src2)
{
}
void execute(Bytecode::Interpreter&) const;
String to_string() const;
private:
Register m_dst;
Register m_src1;
Register m_src2;
};
class LessThan final : public Instruction {
public:
LessThan(Register dst, Register src1, Register src2)
@ -165,6 +203,25 @@ private:
Register m_src2;
};
class LessThanEquals final : public Instruction {
public:
LessThanEquals(Register dst, Register src1, Register src2)
: Instruction(Type::LessThanEquals)
, m_dst(dst)
, m_src1(src1)
, m_src2(src2)
{
}
void execute(Bytecode::Interpreter&) const;
String to_string() const;
private:
Register m_dst;
Register m_src1;
Register m_src2;
};
class AbstractInequals final : public Instruction {
public:
AbstractInequals(Register dst, Register src1, Register src2)