mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: Make marking object indexed properties less allocation-heavy
We were building up a vector with all the values in an object's indexed property storage, and then iterating over the vector to mark values. Instead of this, simply iterate over the property storage directly. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 00:59:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6c4b823cefb
@@ -818,8 +818,9 @@ void Object::visit_edges(Cell::Visitor& visitor)
|
||||
for (auto& value : m_storage)
|
||||
visitor.visit(value);
|
||||
|
||||
for (auto& value : m_indexed_properties.values_unordered())
|
||||
visitor.visit(value.value);
|
||||
m_indexed_properties.for_each_value([&visitor](auto& value) {
|
||||
visitor.visit(value);
|
||||
});
|
||||
}
|
||||
|
||||
bool Object::has_property(const PropertyName& property_name) const
|
||||
|
||||
Reference in New Issue
Block a user