diff options
author | Andreas Kling <kling@serenityos.org> | 2020-11-28 14:33:36 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-28 17:16:48 +0100 |
commit | 98f2da9834e80b125983fe59c804e39bc362f7ce (patch) | |
tree | 3c1698591cd9612f78a420050caad412110bf35c | |
parent | 97a05ac9ac56ed01720867443006db711898dbd1 (diff) | |
download | serenity-98f2da9834e80b125983fe59c804e39bc362f7ce.zip |
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.
32 files changed, 48 insertions, 48 deletions
diff --git a/Libraries/LibJS/Heap/Heap.cpp b/Libraries/LibJS/Heap/Heap.cpp index 1170f82030..c42e9b38f7 100644 --- a/Libraries/LibJS/Heap/Heap.cpp +++ b/Libraries/LibJS/Heap/Heap.cpp @@ -193,7 +193,7 @@ public: dbg() << " ! " << cell; #endif cell->set_marked(true); - cell->visit_children(*this); + cell->visit_edges(*this); } }; diff --git a/Libraries/LibJS/Runtime/Accessor.h b/Libraries/LibJS/Runtime/Accessor.h index 00aa2eab1a..4e57f918b4 100644 --- a/Libraries/LibJS/Runtime/Accessor.h +++ b/Libraries/LibJS/Runtime/Accessor.h @@ -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); diff --git a/Libraries/LibJS/Runtime/ArrayIterator.cpp b/Libraries/LibJS/Runtime/ArrayIterator.cpp index 6257ac1235..338ec0a0bc 100644 --- a/Libraries/LibJS/Runtime/ArrayIterator.cpp +++ b/Libraries/LibJS/Runtime/ArrayIterator.cpp @@ -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); } diff --git a/Libraries/LibJS/Runtime/ArrayIterator.h b/Libraries/LibJS/Runtime/ArrayIterator.h index aefa1583a4..bd68d96eeb 100644 --- a/Libraries/LibJS/Runtime/ArrayIterator.h +++ b/Libraries/LibJS/Runtime/ArrayIterator.h @@ -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; diff --git a/Libraries/LibJS/Runtime/BigIntObject.cpp b/Libraries/LibJS/Runtime/BigIntObject.cpp index d315643d67..eea70af64e 100644 --- a/Libraries/LibJS/Runtime/BigIntObject.cpp +++ b/Libraries/LibJS/Runtime/BigIntObject.cpp @@ -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); } diff --git a/Libraries/LibJS/Runtime/BigIntObject.h b/Libraries/LibJS/Runtime/BigIntObject.h index 05a3e9db6b..274e606327 100644 --- a/Libraries/LibJS/Runtime/BigIntObject.h +++ b/Libraries/LibJS/Runtime/BigIntObject.h @@ -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; diff --git a/Libraries/LibJS/Runtime/BoundFunction.cpp b/Libraries/LibJS/Runtime/BoundFunction.cpp index 82ad1aba41..891eebc57b 100644 --- a/Libraries/LibJS/Runtime/BoundFunction.cpp +++ b/Libraries/LibJS/Runtime/BoundFunction.cpp @@ -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); } diff --git a/Libraries/LibJS/Runtime/BoundFunction.h b/Libraries/LibJS/Runtime/BoundFunction.h index 62e9d41918..e20d1a8a05 100644 --- a/Libraries/LibJS/Runtime/BoundFunction.h +++ b/Libraries/LibJS/Runtime/BoundFunction.h @@ -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 { diff --git a/Libraries/LibJS/Runtime/Cell.h b/Libraries/LibJS/Runtime/Cell.h index a8587c3b69..97f555a764 100644 --- a/Libraries/LibJS/Runtime/Cell.h +++ b/Libraries/LibJS/Runtime/Cell.h @@ -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; diff --git a/Libraries/LibJS/Runtime/Exception.cpp b/Libraries/LibJS/Runtime/Exception.cpp index 8695b82720..8bcf005c3a 100644 --- a/Libraries/LibJS/Runtime/Exception.cpp +++ b/Libraries/LibJS/Runtime/Exception.cpp @@ -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); } diff --git a/Libraries/LibJS/Runtime/Exception.h b/Libraries/LibJS/Runtime/Exception.h index 76ff86e71f..630cce9ef6 100644 --- a/Libraries/LibJS/Runtime/Exception.h +++ b/Libraries/LibJS/Runtime/Exception.h @@ -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; diff --git a/Libraries/LibJS/Runtime/Function.cpp b/Libraries/LibJS/Runtime/Function.cpp index 7b604e89fa..e0bd52c0e5 100644 --- a/Libraries/LibJS/Runtime/Function.cpp +++ b/Libraries/LibJS/Runtime/Function.cpp @@ -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); diff --git a/Libraries/LibJS/Runtime/Function.h b/Libraries/LibJS/Runtime/Function.h index 0833acf2db..13bd3f5ccb 100644 --- a/Libraries/LibJS/Runtime/Function.h +++ b/Libraries/LibJS/Runtime/Function.h @@ -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; } diff --git a/Libraries/LibJS/Runtime/GlobalObject.cpp b/Libraries/LibJS/Runtime/GlobalObject.cpp index 9d49598464..84e85de8c1 100644 --- a/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -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); diff --git a/Libraries/LibJS/Runtime/GlobalObject.h b/Libraries/LibJS/Runtime/GlobalObject.h index d3aa83855d..1bf49be795 100644 --- a/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Libraries/LibJS/Runtime/GlobalObject.h @@ -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); diff --git a/Libraries/LibJS/Runtime/LexicalEnvironment.cpp b/Libraries/LibJS/Runtime/LexicalEnvironment.cpp index 87d504ae1a..5a8157af2c 100644 --- a/Libraries/LibJS/Runtime/LexicalEnvironment.cpp +++ b/Libraries/LibJS/Runtime/LexicalEnvironment.cpp @@ -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); diff --git a/Libraries/LibJS/Runtime/LexicalEnvironment.h b/Libraries/LibJS/Runtime/LexicalEnvironment.h index e939cb5d2a..28a5f2537a 100644 --- a/Libraries/LibJS/Runtime/LexicalEnvironment.h +++ b/Libraries/LibJS/Runtime/LexicalEnvironment.h @@ -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 }; diff --git a/Libraries/LibJS/Runtime/Object.cpp b/Libraries/LibJS/Runtime/Object.cpp index d676a02d88..e9631f7621 100644 --- a/Libraries/LibJS/Runtime/Object.cpp +++ b/Libraries/LibJS/Runtime/Object.cpp @@ -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) diff --git a/Libraries/LibJS/Runtime/Object.h b/Libraries/LibJS/Runtime/Object.h index dc26719b2c..a462c43b44 100644 --- a/Libraries/LibJS/Runtime/Object.h +++ b/Libraries/LibJS/Runtime/Object.h @@ -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; diff --git a/Libraries/LibJS/Runtime/ProxyObject.cpp b/Libraries/LibJS/Runtime/ProxyObject.cpp index 4096558bdc..12f9a99202 100644 --- a/Libraries/LibJS/Runtime/ProxyObject.cpp +++ b/Libraries/LibJS/Runtime/ProxyObject.cpp @@ -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); } diff --git a/Libraries/LibJS/Runtime/ProxyObject.h b/Libraries/LibJS/Runtime/ProxyObject.h index 911bbe5067..c896c3f4a0 100644 --- a/Libraries/LibJS/Runtime/ProxyObject.h +++ b/Libraries/LibJS/Runtime/ProxyObject.h @@ -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(); } diff --git a/Libraries/LibJS/Runtime/ScriptFunction.cpp b/Libraries/LibJS/Runtime/ScriptFunction.cpp index 4fd0ac399b..c8b1d7be6f 100644 --- a/Libraries/LibJS/Runtime/ScriptFunction.cpp +++ b/Libraries/LibJS/Runtime/ScriptFunction.cpp @@ -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); } diff --git a/Libraries/LibJS/Runtime/ScriptFunction.h b/Libraries/LibJS/Runtime/ScriptFunction.h index 9592b5ef35..346d6e8219 100644 --- a/Libraries/LibJS/Runtime/ScriptFunction.h +++ b/Libraries/LibJS/Runtime/ScriptFunction.h @@ -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(); diff --git a/Libraries/LibJS/Runtime/Shape.cpp b/Libraries/LibJS/Runtime/Shape.cpp index 85c7af9595..42cfcaa73e 100644 --- a/Libraries/LibJS/Runtime/Shape.cpp +++ b/Libraries/LibJS/Runtime/Shape.cpp @@ -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); } } diff --git a/Libraries/LibJS/Runtime/Shape.h b/Libraries/LibJS/Runtime/Shape.h index 279462e927..aef09cd375 100644 --- a/Libraries/LibJS/Runtime/Shape.h +++ b/Libraries/LibJS/Runtime/Shape.h @@ -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; diff --git a/Libraries/LibJS/Runtime/StringObject.cpp b/Libraries/LibJS/Runtime/StringObject.cpp index 2b056d1916..cfe1fd6fd8 100644 --- a/Libraries/LibJS/Runtime/StringObject.cpp +++ b/Libraries/LibJS/Runtime/StringObject.cpp @@ -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); } diff --git a/Libraries/LibJS/Runtime/StringObject.h b/Libraries/LibJS/Runtime/StringObject.h index d01de70306..b0ffd30b4a 100644 --- a/Libraries/LibJS/Runtime/StringObject.h +++ b/Libraries/LibJS/Runtime/StringObject.h @@ -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; diff --git a/Libraries/LibJS/Runtime/StringOrSymbol.h b/Libraries/LibJS/Runtime/StringOrSymbol.h index b21c1785c6..38311b61b2 100644 --- a/Libraries/LibJS/Runtime/StringOrSymbol.h +++ b/Libraries/LibJS/Runtime/StringOrSymbol.h @@ -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())); diff --git a/Libraries/LibJS/Runtime/SymbolObject.cpp b/Libraries/LibJS/Runtime/SymbolObject.cpp index d78a4377de..deb1170928 100644 --- a/Libraries/LibJS/Runtime/SymbolObject.cpp +++ b/Libraries/LibJS/Runtime/SymbolObject.cpp @@ -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); } diff --git a/Libraries/LibJS/Runtime/SymbolObject.h b/Libraries/LibJS/Runtime/SymbolObject.h index 31e5a3e87e..7b8418e2be 100644 --- a/Libraries/LibJS/Runtime/SymbolObject.h +++ b/Libraries/LibJS/Runtime/SymbolObject.h @@ -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; diff --git a/Libraries/LibWeb/Bindings/WindowObject.cpp b/Libraries/LibWeb/Bindings/WindowObject.cpp index 66f4855c4a..7d271f00e5 100644 --- a/Libraries/LibWeb/Bindings/WindowObject.cpp +++ b/Libraries/LibWeb/Bindings/WindowObject.cpp @@ -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); } diff --git a/Libraries/LibWeb/Bindings/WindowObject.h b/Libraries/LibWeb/Bindings/WindowObject.h index a1a9a27c9d..b3e1e92959 100644 --- a/Libraries/LibWeb/Bindings/WindowObject.h +++ b/Libraries/LibWeb/Bindings/WindowObject.h @@ -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); |