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
commit 212319b25e
Notes: sideshowbarker 2024-07-17 23:05:47 +09:00
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]]
};
}