mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:37:35 +00:00
LibJS: Add bytecode instructions for modulo and exponentiation
This commit is contained in:
parent
6af9d87258
commit
55f0791b13
4 changed files with 66 additions and 0 deletions
|
@ -108,6 +108,44 @@ private:
|
|||
Register m_src2;
|
||||
};
|
||||
|
||||
class Mod final : public Instruction {
|
||||
public:
|
||||
Mod(Register dst, Register src1, Register src2)
|
||||
: Instruction(Type::Mod)
|
||||
, 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 Exp final : public Instruction {
|
||||
public:
|
||||
Exp(Register dst, Register src1, Register src2)
|
||||
: Instruction(Type::Exp)
|
||||
, 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue