mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibJS+LibWeb: Explicitly mark ignored members in visit_edges methods
This commit is contained in:
parent
39d8c8d2a9
commit
a9d192e882
4 changed files with 13 additions and 0 deletions
|
@ -80,6 +80,13 @@ public:
|
|||
visit_impl(value.as_cell());
|
||||
}
|
||||
|
||||
// Allow explicitly ignoring a GC-allocated member in a visit_edges implementation instead
|
||||
// of just not using it.
|
||||
template<typename T>
|
||||
void ignore(T const&)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void visit_impl(Cell&) = 0;
|
||||
virtual ~Visitor() = default;
|
||||
|
|
|
@ -123,6 +123,7 @@ void Shape::visit_edges(Cell::Visitor& visitor)
|
|||
for (auto& it : *m_property_table)
|
||||
it.key.visit_edges(visitor);
|
||||
}
|
||||
visitor.ignore(m_prototype_transitions);
|
||||
}
|
||||
|
||||
Optional<PropertyMetadata> Shape::lookup(StringOrSymbol const& property_key) const
|
||||
|
|
|
@ -37,6 +37,7 @@ void EnvironmentSettingsObject::visit_edges(Cell::Visitor& visitor)
|
|||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(target_browsing_context);
|
||||
visitor.ignore(m_outstanding_rejected_promises_weak_set);
|
||||
}
|
||||
|
||||
JS::ExecutionContext& EnvironmentSettingsObject::realm_execution_context()
|
||||
|
|
|
@ -44,6 +44,10 @@ void Worker::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_inner_settings);
|
||||
visitor.visit(m_implicit_port);
|
||||
visitor.visit(m_outside_port);
|
||||
|
||||
// These are in a separate VM and shouldn't be visited
|
||||
visitor.ignore(m_worker_realm);
|
||||
visitor.ignore(m_worker_scope);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#dom-worker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue