1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:48:14 +00:00

LibJS: Add AbstractEquals bytecode instruction for == comparison :^)

This commit is contained in:
Andreas Kling 2021-06-06 13:36:34 +02:00
parent 4bdfe73895
commit 0cc9d47e1b
3 changed files with 32 additions and 0 deletions

View file

@ -38,6 +38,11 @@ void AbstractInequals::execute(Bytecode::Interpreter& interpreter) const
interpreter.reg(m_dst) = Value(!abstract_eq(interpreter.global_object(), interpreter.reg(m_src1), interpreter.reg(m_src2)));
}
void AbstractEquals::execute(Bytecode::Interpreter& interpreter) const
{
interpreter.reg(m_dst) = Value(abstract_eq(interpreter.global_object(), interpreter.reg(m_src1), interpreter.reg(m_src2)));
}
void NewString::execute(Bytecode::Interpreter& interpreter) const
{
interpreter.reg(m_dst) = js_string(interpreter.vm(), m_string);
@ -164,6 +169,11 @@ String AbstractInequals::to_string() const
return String::formatted("AbstractInequals dst:{}, src1:{}, src2:{}", m_dst, m_src1, m_src2);
}
String AbstractEquals::to_string() const
{
return String::formatted("AbstractEquals dst:{}, src1:{}, src2:{}", m_dst, m_src1, m_src2);
}
String NewString::to_string() const
{
return String::formatted("NewString dst:{}, string:\"{}\"", m_dst, m_string);