mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibJS: Don't allocate property table during GC marking phase
Shape was allocating property tables inside visit_children(), which could cause garbage collection to happen. It's not very good to start a new garbage collection while you are in the middle of one already.
This commit is contained in:
parent
4036ff9d91
commit
893df28e80
Notes:
sideshowbarker
2024-07-19 02:19:33 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/893df28e803
|
@ -104,9 +104,10 @@ void Shape::visit_children(Cell::Visitor& visitor)
|
|||
for (auto& it : m_forward_transitions)
|
||||
visitor.visit(it.value);
|
||||
|
||||
ensure_property_table();
|
||||
for (auto& it : *m_property_table)
|
||||
it.key.visit_children(visitor);
|
||||
if (m_property_table) {
|
||||
for (auto& it : *m_property_table)
|
||||
it.key.visit_children(visitor);
|
||||
}
|
||||
}
|
||||
|
||||
Optional<PropertyMetadata> Shape::lookup(const StringOrSymbol& property_name) const
|
||||
|
|
Loading…
Reference in a new issue