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

Note that we still call out to a C++ helper, but by having a builtin,
we still avoid the cost of a full JS function call.
This commit is contained in:
Andreas Kling 2023-11-24 09:31:23 +01:00
commit 1d8a601f96
Notes: sideshowbarker 2024-07-16 22:54:10 +09:00
4 changed files with 28 additions and 5 deletions

View file

@ -12,8 +12,9 @@
namespace JS::Bytecode {
// TitleCaseName, snake_case_name, base, property, argument_count
#define JS_ENUMERATE_BUILTINS(O) \
O(MathAbs, math_abs, Math, abs, 1)
#define JS_ENUMERATE_BUILTINS(O) \
O(MathAbs, math_abs, Math, abs, 1) \
O(MathLog, math_log, Math, log, 1)
enum class Builtin {
#define DEFINE_BUILTIN_ENUM(name, ...) name,