mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
LibJS: Add fast_is<T> for StringObject and GlobalObject
Both of these are quite hot in profiles.
This commit is contained in:
parent
43f0c92bcd
commit
0a911178ce
3 changed files with 14 additions and 0 deletions
|
@ -76,6 +76,8 @@ protected:
|
|||
void add_constructor(const FlyString& property_name, ConstructorType*&, Object* prototype);
|
||||
|
||||
private:
|
||||
virtual bool is_global_object() const final { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(gc);
|
||||
JS_DECLARE_NATIVE_FUNCTION(is_nan);
|
||||
JS_DECLARE_NATIVE_FUNCTION(is_finite);
|
||||
|
@ -131,4 +133,7 @@ inline GlobalObject* Shape::global_object() const
|
|||
return static_cast<GlobalObject*>(m_global_object);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline bool Object::fast_is<GlobalObject>() const { return is_global_object(); }
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue