1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

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
parent a6106ca221
commit 1d8a601f96
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,