mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
LibJS: Skip lazy intrinsic allocation check for objects without them
Most JS::Objects don't have lazily-allocated intrinsic properties, so let's avoid doing hash lookups by putting a flag on JS::Object that tells us whether it's present in s_intrinsics. Takes CPU time spent in those hash lookups from 1-2.5% to nothing on various JS heavy pages.
This commit is contained in:
parent
5925e6f196
commit
620c495d31
2 changed files with 12 additions and 5 deletions
|
@ -212,6 +212,9 @@ private:
|
|||
Object* prototype() { return shape().prototype(); }
|
||||
Object const* prototype() const { return shape().prototype(); }
|
||||
|
||||
// True if this object has lazily allocated intrinsic properties.
|
||||
bool m_has_intrinsic_accessors { false };
|
||||
|
||||
GCPtr<Shape> m_shape;
|
||||
Vector<Value> m_storage;
|
||||
IndexedProperties m_indexed_properties;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue