LibJS: Add builtin for Math.imul()

This commit is contained in:
Andreas Kling 2025-04-03 11:58:30 +02:00 committed by Andreas Kling
commit 714e8aec8a
Notes: github-actions[bot] 2025-04-03 11:57:40 +00:00
4 changed files with 14 additions and 4 deletions

View file

@ -19,6 +19,7 @@ namespace JS::Bytecode {
O(MathExp, math_exp, Math, exp, 1) \
O(MathCeil, math_ceil, Math, ceil, 1) \
O(MathFloor, math_floor, Math, floor, 1) \
O(MathImul, math_imul, Math, imul, 2) \
O(MathRound, math_round, Math, round, 1) \
O(MathSqrt, math_sqrt, Math, sqrt, 1)

View file

@ -2597,6 +2597,8 @@ static ThrowCompletionOr<Value> dispatch_builtin_call(Bytecode::Interpreter& int
return TRY(MathObject::ceil_impl(interpreter.vm(), interpreter.get(arguments[0])));
case Builtin::MathFloor:
return TRY(MathObject::floor_impl(interpreter.vm(), interpreter.get(arguments[0])));
case Builtin::MathImul:
return TRY(MathObject::imul_impl(interpreter.vm(), interpreter.get(arguments[0]), interpreter.get(arguments[1])));
case Builtin::MathRound:
return TRY(MathObject::round_impl(interpreter.vm(), interpreter.get(arguments[0])));
case Builtin::MathSqrt: