1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibJS: Skip an always-false branch in the JIT to_boolean slow case

This commit is contained in:
Idan Horowitz 2023-11-10 18:51:50 +02:00 committed by Andreas Kling
parent 9e637de58a
commit e58209e5cf
2 changed files with 3 additions and 2 deletions

View file

@ -175,7 +175,7 @@ void Compiler::compile_jump(Bytecode::Op::Jump const& op)
static bool cxx_to_boolean(VM&, Value value)
{
return value.to_boolean();
return value.to_boolean_slow_case();
}
void Compiler::compile_to_boolean(Assembler::Reg dst, Assembler::Reg src)

View file

@ -439,8 +439,9 @@ public:
return static_cast<i32>(m_value.encoded & 0xFFFFFFFF);
}
private:
bool to_boolean_slow_case() const;
private:
ThrowCompletionOr<Value> to_number_slow_case(VM&) const;
ThrowCompletionOr<Value> to_numeric_slow_case(VM&) const;
ThrowCompletionOr<Value> to_primitive_slow_case(VM&, PreferredType) const;