mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibJS: Add bytecode ops for &, | and ^
This commit is contained in:
parent
4be3374b24
commit
ae763f1ade
4 changed files with 100 additions and 1 deletions
|
@ -260,6 +260,63 @@ private:
|
|||
Register m_src2;
|
||||
};
|
||||
|
||||
class BitwiseAnd final : public Instruction {
|
||||
public:
|
||||
BitwiseAnd(Register dst, Register src1, Register src2)
|
||||
: Instruction(Type::BitwiseAnd)
|
||||
, 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 BitwiseOr final : public Instruction {
|
||||
public:
|
||||
BitwiseOr(Register dst, Register src1, Register src2)
|
||||
: Instruction(Type::BitwiseOr)
|
||||
, 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 BitwiseXor final : public Instruction {
|
||||
public:
|
||||
BitwiseXor(Register dst, Register src1, Register src2)
|
||||
: Instruction(Type::BitwiseXor)
|
||||
, 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 NewString final : public Instruction {
|
||||
public:
|
||||
NewString(Register dst, String string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue