1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

LibJS: Only allocate space for Object private elements if needed

Most JavaScript objects don't have private elements, so this reduces the
size of typical JS::Object instances by two pointers.
This commit is contained in:
Andreas Kling 2021-12-08 09:38:31 +01:00
parent 444a7eb929
commit 212319b25e
2 changed files with 15 additions and 6 deletions

View file

@ -208,7 +208,7 @@ private:
Shape* m_shape { nullptr };
Vector<Value> m_storage;
IndexedProperties m_indexed_properties;
Vector<PrivateElement> m_private_elements; // [[PrivateElements]]
OwnPtr<Vector<PrivateElement>> m_private_elements; // [[PrivateElements]]
};
}