1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibJS: Add LessThan bytecode instruction :^)

This commit is contained in:
Andreas Kling 2021-06-04 12:03:57 +02:00
parent 6d66cdc668
commit 91640d0727
3 changed files with 32 additions and 0 deletions

View file

@ -26,6 +26,11 @@ void Sub::execute(Bytecode::Interpreter& interpreter) const
interpreter.reg(m_dst) = sub(interpreter.global_object(), interpreter.reg(m_src1), interpreter.reg(m_src2));
}
void LessThan::execute(Bytecode::Interpreter& interpreter) const
{
interpreter.reg(m_dst) = less_than(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);
@ -56,6 +61,11 @@ String Sub::to_string() const
return String::formatted("Sub dst:{}, src1:{}, src2:{}", m_dst, m_src1, m_src2);
}
String LessThan::to_string() const
{
return String::formatted("LessThan dst:{}, src1:{}, src2:{}", m_dst, m_src1, m_src2);
}
String NewString::to_string() const
{
return String::formatted("NewString dst:{}, string:\"{}\"", m_dst, m_string);