LibJS: Inline fast case for Value::to_{boolean,number,numeric,primitive}

These functions all have a very common case that can be dealt with a
very simple inline check, often avoiding the need to call an out-of-line
function. This patch moves the common case to inline functions in a new
ValueInlines.h header (necessary due to header dependency issues..)

8% speed-up on the entire Kraken benchmark :^)
This commit is contained in:
Andreas Kling
2023-10-06 17:54:21 +02:00
parent 42d80aab06
commit 65717e3b75
Notes: sideshowbarker 2024-07-17 05:58:46 +09:00
53 changed files with 111 additions and 8 deletions

View File

@@ -23,6 +23,7 @@
#include <LibJS/Runtime/NumberObject.h>
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/StringObject.h>
#include <LibJS/Runtime/ValueInlines.h>
namespace JS {