mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 13:46:31 +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:
parent
a6106ca221
commit
1d8a601f96
Notes:
sideshowbarker
2024-07-16 22:54:10 +09:00
Author: https://github.com/awesomekling
Commit: 1d8a601f96
Pull-request: https://github.com/SerenityOS/serenity/pull/22041
Reviewed-by: https://github.com/skyrising
4 changed files with 28 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue