mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +00:00
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:
parent
42d80aab06
commit
65717e3b75
53 changed files with 111 additions and 8 deletions
|
@ -440,6 +440,11 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
bool to_boolean_slow_case() const;
|
||||
ThrowCompletionOr<Value> to_number_slow_case(VM&) const;
|
||||
ThrowCompletionOr<Value> to_numeric_slow_case(VM&) const;
|
||||
ThrowCompletionOr<Value> to_primitive_slow_case(VM&, PreferredType) const;
|
||||
|
||||
Value(u64 tag, u64 val)
|
||||
{
|
||||
VERIFY(!(tag & val));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue