From 8eacb81ebaf229e947b22beaf581e1860e48076e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 11 Dec 2023 16:50:04 +0100 Subject: [PATCH] LibJS: Skip redundant marking of Shape property table keys All the keys in a property table are guaranteed to be marked via Shape::m_property_key in each step of the transition chain that leads up to the Shape. --- Userland/Libraries/LibJS/Runtime/Shape.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Shape.cpp b/Userland/Libraries/LibJS/Runtime/Shape.cpp index 321f9de254..8796638c8f 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.cpp +++ b/Userland/Libraries/LibJS/Runtime/Shape.cpp @@ -135,10 +135,10 @@ void Shape::visit_edges(Cell::Visitor& visitor) visitor.visit(m_prototype); visitor.visit(m_previous); m_property_key.visit_edges(visitor); - if (m_property_table) { - for (auto& it : *m_property_table) - it.key.visit_edges(visitor); - } + + // NOTE: We don't need to mark the keys in the property table, since they are guaranteed + // to also be marked by the chain of shapes leading up to this one. + visitor.ignore(m_prototype_transitions); // FIXME: The forward transition keys should be weak, but we have to mark them for now in case they go stale.