mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17: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
|
@ -66,6 +66,7 @@ public:
|
|||
EnvironmentRecordType type() const { return m_environment_record_type; }
|
||||
|
||||
private:
|
||||
virtual bool is_lexical_environment() const override { return true; }
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
EnvironmentRecordType m_environment_record_type : 8 { EnvironmentRecordType::Declarative };
|
||||
|
@ -78,4 +79,7 @@ private:
|
|||
Function* m_current_function { nullptr };
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Object::fast_is<LexicalEnvironment>() const { return is_lexical_environment(); }
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue