mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibJS: Add a bunch of fast_is<T> to avoid slow RTTI in hot code
This commit is contained in:
parent
39ad705c13
commit
095accd2b2
5 changed files with 61 additions and 0 deletions
|
@ -35,9 +35,13 @@ protected:
|
|||
|
||||
private:
|
||||
virtual LexicalEnvironment* create_environment() override final;
|
||||
virtual bool is_native_function() const final { return true; }
|
||||
|
||||
FlyString m_name;
|
||||
AK::Function<Value(VM&, GlobalObject&)> m_native_function;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Object::fast_is<NativeFunction>() const { return is_native_function(); }
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue