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

LibJS/JIT: Add builtin for Math.exp()

This commit is contained in:
Andreas Kling 2023-11-24 09:53:52 +01:00
parent 8447544e17
commit afeb551d57
4 changed files with 24 additions and 3 deletions

View file

@ -2702,6 +2702,19 @@ void Compiler::compile_builtin_math_round(Assembler::Label&, Assembler::Label& e
m_assembler.jump(end);
}
static Value cxx_math_exp(VM& vm, Value, Value value)
{
return TRY_OR_SET_EXCEPTION(MathObject::exp_impl(vm, value));
}
void Compiler::compile_builtin_math_exp(Assembler::Label&, Assembler::Label& end)
{
native_call((void*)cxx_math_exp);
store_accumulator(RET);
check_exception();
m_assembler.jump(end);
}
void Compiler::compile_builtin_math_abs(Assembler::Label& slow_case, Assembler::Label& end)
{
branch_if_int32(ARG2, [&] {