mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
LibJS/JIT: Add builtin for Math.pow()
This commit is contained in:
parent
94b634f029
commit
5e976d611e
4 changed files with 25 additions and 4 deletions
|
@ -2650,6 +2650,19 @@ void Compiler::compile_builtin_math_sqrt(Assembler::Label&, Assembler::Label& en
|
|||
m_assembler.jump(end);
|
||||
}
|
||||
|
||||
static Value cxx_math_pow(VM& vm, Value, Value base, Value exponent)
|
||||
{
|
||||
return TRY_OR_SET_EXCEPTION(MathObject::pow_impl(vm, base, exponent));
|
||||
}
|
||||
|
||||
void Compiler::compile_builtin_math_pow(Assembler::Label&, Assembler::Label& end)
|
||||
{
|
||||
native_call((void*)cxx_math_pow);
|
||||
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, [&] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue