LibJS: Rename Cell::visit_children() => Cell::visit_edges()

The GC heap is really a graph of cells, so "children" didn't quite feel
appropriate here.
This commit is contained in:
Andreas Kling 2020-11-28 14:33:36 +01:00
parent 97a05ac9ac
commit 98f2da9834
Notes: sideshowbarker 2024-07-19 01:13:10 +09:00
32 changed files with 48 additions and 48 deletions

View file

@ -193,7 +193,7 @@ public:
dbg() << " ! " << cell;
#endif
cell->set_marked(true);
cell->visit_children(*this);
cell->visit_edges(*this);
}
};

View file

@ -66,7 +66,7 @@ public:
(void)vm().call(*m_setter, this_value, setter_value);
}
void visit_children(Cell::Visitor& visitor) override
void visit_edges(Cell::Visitor& visitor) override
{
visitor.visit(m_getter);
visitor.visit(m_setter);

View file

@ -45,9 +45,9 @@ ArrayIterator::~ArrayIterator()
{
}
void ArrayIterator::visit_children(Cell::Visitor& visitor)
void ArrayIterator::visit_edges(Cell::Visitor& visitor)
{
Base::visit_children(visitor);
Base::visit_edges(visitor);
visitor.visit(m_array);
}

View file

@ -47,7 +47,7 @@ private:
friend class ArrayIteratorPrototype;
virtual bool is_array_iterator_object() const override { return true; }
virtual void visit_children(Cell::Visitor&) override;
virtual void visit_edges(Cell::Visitor&) override;
Value m_array;
Object::PropertyKind m_iteration_kind;

View file

@ -45,9 +45,9 @@ BigIntObject::~BigIntObject()
{
}
void BigIntObject::visit_children(Cell::Visitor& visitor)
void BigIntObject::visit_edges(Cell::Visitor& visitor)
{
Object::visit_children(visitor);
Object::visit_edges(visitor);
visitor.visit(&m_bigint);
}

View file

@ -47,7 +47,7 @@ public:
}
private:
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
virtual bool is_bigint_object() const override { return true; }
BigInt& m_bigint;

View file

@ -69,9 +69,9 @@ LexicalEnvironment* BoundFunction::create_environment()
return m_target_function->create_environment();
}
void BoundFunction::visit_children(Visitor& visitor)
void BoundFunction::visit_edges(Visitor& visitor)
{
Function::visit_children(visitor);
Function::visit_edges(visitor);
visitor.visit(m_target_function);
visitor.visit(m_constructor_prototype);
}

View file

@ -44,7 +44,7 @@ public:
virtual LexicalEnvironment* create_environment() override;
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
virtual const FlyString& name() const override
{

View file

@ -57,7 +57,7 @@ public:
virtual void visit_impl(Cell*) = 0;
};
virtual void visit_children(Visitor&) { }
virtual void visit_edges(Visitor&) { }
Heap& heap() const;
VM& vm() const;

View file

@ -46,9 +46,9 @@ Exception::~Exception()
{
}
void Exception::visit_children(Visitor& visitor)
void Exception::visit_edges(Visitor& visitor)
{
Cell::visit_children(visitor);
Cell::visit_edges(visitor);
visitor.visit(m_value);
}

View file

@ -42,7 +42,7 @@ public:
private:
virtual const char* class_name() const override { return "Exception"; }
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
Value m_value;
Vector<String> m_trace;

View file

@ -86,9 +86,9 @@ BoundFunction* Function::bind(Value bound_this_value, Vector<Value> arguments)
return heap().allocate<BoundFunction>(global_object(), global_object(), target_function, bound_this_object, move(all_bound_arguments), computed_length, constructor_prototype);
}
void Function::visit_children(Visitor& visitor)
void Function::visit_edges(Visitor& visitor)
{
Object::visit_children(visitor);
Object::visit_edges(visitor);
visitor.visit(m_bound_this);

View file

@ -48,7 +48,7 @@ public:
virtual const FlyString& name() const = 0;
virtual LexicalEnvironment* create_environment() = 0;
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
virtual bool is_script_function() const { return false; }

View file

@ -147,9 +147,9 @@ GlobalObject::~GlobalObject()
{
}
void GlobalObject::visit_children(Visitor& visitor)
void GlobalObject::visit_edges(Visitor& visitor)
{
Object::visit_children(visitor);
Object::visit_edges(visitor);
visitor.visit(m_empty_object_shape);
visitor.visit(m_new_object_shape);

View file

@ -60,7 +60,7 @@ public:
#undef __JS_ENUMERATE
protected:
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
template<typename ConstructorType>
void add_constructor(const FlyString& property_name, ConstructorType*&, Object& prototype);

View file

@ -59,9 +59,9 @@ LexicalEnvironment::~LexicalEnvironment()
{
}
void LexicalEnvironment::visit_children(Visitor& visitor)
void LexicalEnvironment::visit_edges(Visitor& visitor)
{
Cell::visit_children(visitor);
Cell::visit_edges(visitor);
visitor.visit(m_parent);
visitor.visit(m_this_value);
visitor.visit(m_home_object);

View file

@ -91,7 +91,7 @@ public:
private:
virtual const char* class_name() const override { return "LexicalEnvironment"; }
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
EnvironmentRecordType m_environment_record_type : 8 { EnvironmentRecordType::Declarative };
ThisBindingStatus m_this_binding_status : 8 { ThisBindingStatus::Uninitialized };

View file

@ -813,9 +813,9 @@ bool Object::define_native_property(const StringOrSymbol& property_name, AK::Fun
return define_property(property_name, heap().allocate_without_global_object<NativeProperty>(move(getter), move(setter)), attribute);
}
void Object::visit_children(Cell::Visitor& visitor)
void Object::visit_edges(Cell::Visitor& visitor)
{
Cell::visit_children(visitor);
Cell::visit_edges(visitor);
visitor.visit(m_shape);
for (auto& value : m_storage)

View file

@ -129,7 +129,7 @@ public:
virtual bool is_array_iterator_object() const { return false; }
virtual const char* class_name() const override { return "Object"; }
virtual void visit_children(Cell::Visitor&) override;
virtual void visit_edges(Cell::Visitor&) override;
virtual Object* prototype();
virtual const Object* prototype() const;

View file

@ -467,9 +467,9 @@ Value ProxyObject::delete_property(const PropertyName& name)
return Value(true);
}
void ProxyObject::visit_children(Cell::Visitor& visitor)
void ProxyObject::visit_edges(Cell::Visitor& visitor)
{
Function::visit_children(visitor);
Function::visit_edges(visitor);
visitor.visit(&m_target);
visitor.visit(&m_handler);
}

View file

@ -62,7 +62,7 @@ public:
void revoke() { m_is_revoked = true; }
private:
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
virtual bool is_proxy_object() const override { return true; }
virtual bool is_function() const override { return m_target.is_function(); }

View file

@ -81,9 +81,9 @@ ScriptFunction::~ScriptFunction()
{
}
void ScriptFunction::visit_children(Visitor& visitor)
void ScriptFunction::visit_edges(Visitor& visitor)
{
Function::visit_children(visitor);
Function::visit_edges(visitor);
visitor.visit(m_parent_environment);
}

View file

@ -58,7 +58,7 @@ protected:
private:
virtual bool is_script_function() const override { return true; }
virtual LexicalEnvironment* create_environment() override;
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
Value execute_function_body();

View file

@ -101,19 +101,19 @@ Shape::~Shape()
{
}
void Shape::visit_children(Cell::Visitor& visitor)
void Shape::visit_edges(Cell::Visitor& visitor)
{
Cell::visit_children(visitor);
Cell::visit_edges(visitor);
visitor.visit(m_global_object);
visitor.visit(m_prototype);
visitor.visit(m_previous);
m_property_name.visit_children(visitor);
m_property_name.visit_edges(visitor);
for (auto& it : m_forward_transitions)
visitor.visit(it.value);
if (m_property_table) {
for (auto& it : *m_property_table)
it.key.visit_children(visitor);
it.key.visit_edges(visitor);
}
}

View file

@ -102,7 +102,7 @@ public:
private:
virtual const char* class_name() const override { return "Shape"; }
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
void ensure_property_table() const;

View file

@ -48,9 +48,9 @@ StringObject::~StringObject()
{
}
void StringObject::visit_children(Cell::Visitor& visitor)
void StringObject::visit_edges(Cell::Visitor& visitor)
{
Object::visit_children(visitor);
Object::visit_edges(visitor);
visitor.visit(&m_string);
}

View file

@ -46,7 +46,7 @@ public:
}
private:
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
virtual bool is_string_object() const override { return true; }
PrimitiveString& m_string;

View file

@ -126,7 +126,7 @@ public:
return {};
}
void visit_children(Cell::Visitor& visitor)
void visit_edges(Cell::Visitor& visitor)
{
if (is_symbol())
visitor.visit(const_cast<Symbol*>(as_symbol()));

View file

@ -48,9 +48,9 @@ SymbolObject::~SymbolObject()
{
}
void SymbolObject::visit_children(Cell::Visitor& visitor)
void SymbolObject::visit_edges(Cell::Visitor& visitor)
{
Object::visit_children(visitor);
Object::visit_edges(visitor);
visitor.visit(&m_symbol);
}

View file

@ -52,7 +52,7 @@ public:
}
private:
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
virtual bool is_symbol_object() const override { return true; }
Symbol& m_symbol;

View file

@ -94,9 +94,9 @@ WindowObject::~WindowObject()
{
}
void WindowObject::visit_children(Visitor& visitor)
void WindowObject::visit_edges(Visitor& visitor)
{
GlobalObject::visit_children(visitor);
GlobalObject::visit_edges(visitor);
visitor.visit(m_xhr_constructor);
visitor.visit(m_xhr_prototype);
}

View file

@ -52,7 +52,7 @@ public:
private:
virtual const char* class_name() const override { return "WindowObject"; }
virtual void visit_children(Visitor&) override;
virtual void visit_edges(Visitor&) override;
JS_DECLARE_NATIVE_GETTER(document_getter);
JS_DECLARE_NATIVE_SETTER(document_setter);