summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Bytecode/Op.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Bytecode/Op.cpp')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Op.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp
index 2a71384d3a..f44086f3e9 100644
--- a/Userland/Libraries/LibJS/Bytecode/Op.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -142,11 +143,6 @@ void BitwiseXor::execute(Bytecode::Interpreter& interpreter) const
interpreter.reg(m_dst) = bitwise_xor(interpreter.global_object(), interpreter.reg(m_src1), interpreter.reg(m_src2));
}
-void BitwiseNot::execute(Bytecode::Interpreter& interpreter) const
-{
- interpreter.reg(m_dst) = bitwise_not(interpreter.global_object(), interpreter.reg(m_src));
-}
-
void LeftShift::execute(Bytecode::Interpreter& interpreter) const
{
interpreter.reg(m_dst) = left_shift(interpreter.global_object(), interpreter.reg(m_src1), interpreter.reg(m_src2));
@@ -162,6 +158,16 @@ void UnsignedRightShift::execute(Bytecode::Interpreter& interpreter) const
interpreter.reg(m_dst) = unsigned_right_shift(interpreter.global_object(), interpreter.reg(m_src1), interpreter.reg(m_src2));
}
+void In::execute(Bytecode::Interpreter& interpreter) const
+{
+ interpreter.reg(m_dst) = in(interpreter.global_object(), interpreter.reg(m_src1), interpreter.reg(m_src2));
+}
+
+void BitwiseNot::execute(Bytecode::Interpreter& interpreter) const
+{
+ interpreter.reg(m_dst) = bitwise_not(interpreter.global_object(), interpreter.reg(m_src));
+}
+
void Not::execute(Bytecode::Interpreter& interpreter) const
{
interpreter.reg(m_dst) = Value(!interpreter.reg(m_src).to_boolean());
@@ -394,6 +400,11 @@ String UnsignedRightShift::to_string() const
return String::formatted("UnsignedRightShift dst:{}, src1:{}, src2:{}", m_dst, m_src1, m_src2);
}
+String In::to_string() const
+{
+ return String::formatted("In dst:{}, src1:{}, src2:{}", m_dst, m_src1, m_src2);
+}
+
String BitwiseNot::to_string() const
{
return String::formatted("BitwiseNot dst:{}, src:{}", m_dst, m_src);