mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:47:37 +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
|
@ -46,10 +46,14 @@ private:
|
|||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
virtual bool is_function() const override { return m_target.is_function(); }
|
||||
virtual bool is_proxy_object() const final { return true; }
|
||||
|
||||
Object& m_target;
|
||||
Object& m_handler;
|
||||
bool m_is_revoked { false };
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Object::fast_is<ProxyObject>() const { return is_proxy_object(); }
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue