mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +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
Notes:
sideshowbarker
2024-07-18 12:18:29 +09:00
Author: https://github.com/awesomekling
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