Ver código fonte

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.
Andreas Kling 1 ano atrás
pai
commit
8eacb81eba
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      Userland/Libraries/LibJS/Runtime/Shape.cpp

+ 4 - 4
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.