mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:47:34 +00:00
LibJS/Bytecode: Fuse [Not, JumpIf] instructions into JumpIfNot
This commit is contained in:
parent
4438ec481c
commit
795149e585
5 changed files with 53 additions and 0 deletions
|
@ -1123,6 +1123,23 @@ private:
|
|||
Operand m_condition;
|
||||
};
|
||||
|
||||
class JumpIfNot final : public Jump {
|
||||
public:
|
||||
explicit JumpIfNot(Operand condition, Label true_target, Label false_target)
|
||||
: Jump(Type::JumpIfNot, move(true_target), move(false_target), sizeof(*this))
|
||||
, m_condition(condition)
|
||||
{
|
||||
}
|
||||
|
||||
ThrowCompletionOr<void> execute_impl(Bytecode::Interpreter&) const;
|
||||
ByteString to_byte_string_impl(Bytecode::Executable const&) const;
|
||||
|
||||
Operand condition() const { return m_condition; }
|
||||
|
||||
private:
|
||||
Operand m_condition;
|
||||
};
|
||||
|
||||
// NOTE: The raw operator is used for comparing two Int32 values.
|
||||
#define JS_ENUMERATE_FUSABLE_BINARY_OPS(X) \
|
||||
X(GreaterThan, >, greater_than) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue