1
Fork 0
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:
Andreas Kling 2021-06-13 11:23:23 +02:00
parent 39ad705c13
commit 095accd2b2
5 changed files with 61 additions and 0 deletions

View file

@ -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(); }
}