LibJS: Add fast_is<T> helpers for all the primitive wrapper objects

The JS runtime is full of checks for is<NumberObject> and friends.
They were showing up in a Speedometer profile as ~1% spent in
dynamic_cast, and this basically chops that down to nothing.
This commit is contained in:
Andreas Kling 2025-03-25 08:34:06 +00:00 committed by Andreas Kling
commit c12f8b80dc
Notes: github-actions[bot] 2025-03-25 23:58:13 +00:00
7 changed files with 35 additions and 0 deletions

View file

@ -190,6 +190,12 @@ public:
virtual bool is_dom_node() const { return false; }
virtual bool is_function() const { return false; }
virtual bool is_error() const { return false; }
virtual bool is_date() const { return false; }
virtual bool is_number_object() const { return false; }
virtual bool is_boolean_object() const { return false; }
virtual bool is_regexp_object() const { return false; }
virtual bool is_bigint_object() const { return false; }
virtual bool is_string_object() const { return false; }
virtual bool is_global_object() const { return false; }
virtual bool is_proxy_object() const { return false; }