Forráskód Böngészése

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.
Andreas Kling 4 éve
szülő
commit
98f2da9834
32 módosított fájl, 48 hozzáadás és 48 törlés
  1. 1 1
      Libraries/LibJS/Heap/Heap.cpp
  2. 1 1
      Libraries/LibJS/Runtime/Accessor.h
  3. 2 2
      Libraries/LibJS/Runtime/ArrayIterator.cpp
  4. 1 1
      Libraries/LibJS/Runtime/ArrayIterator.h
  5. 2 2
      Libraries/LibJS/Runtime/BigIntObject.cpp
  6. 1 1
      Libraries/LibJS/Runtime/BigIntObject.h
  7. 2 2
      Libraries/LibJS/Runtime/BoundFunction.cpp
  8. 1 1
      Libraries/LibJS/Runtime/BoundFunction.h
  9. 1 1
      Libraries/LibJS/Runtime/Cell.h
  10. 2 2
      Libraries/LibJS/Runtime/Exception.cpp
  11. 1 1
      Libraries/LibJS/Runtime/Exception.h
  12. 2 2
      Libraries/LibJS/Runtime/Function.cpp
  13. 1 1
      Libraries/LibJS/Runtime/Function.h
  14. 2 2
      Libraries/LibJS/Runtime/GlobalObject.cpp
  15. 1 1
      Libraries/LibJS/Runtime/GlobalObject.h
  16. 2 2
      Libraries/LibJS/Runtime/LexicalEnvironment.cpp
  17. 1 1
      Libraries/LibJS/Runtime/LexicalEnvironment.h
  18. 2 2
      Libraries/LibJS/Runtime/Object.cpp
  19. 1 1
      Libraries/LibJS/Runtime/Object.h
  20. 2 2
      Libraries/LibJS/Runtime/ProxyObject.cpp
  21. 1 1
      Libraries/LibJS/Runtime/ProxyObject.h
  22. 2 2
      Libraries/LibJS/Runtime/ScriptFunction.cpp
  23. 1 1
      Libraries/LibJS/Runtime/ScriptFunction.h
  24. 4 4
      Libraries/LibJS/Runtime/Shape.cpp
  25. 1 1
      Libraries/LibJS/Runtime/Shape.h
  26. 2 2
      Libraries/LibJS/Runtime/StringObject.cpp
  27. 1 1
      Libraries/LibJS/Runtime/StringObject.h
  28. 1 1
      Libraries/LibJS/Runtime/StringOrSymbol.h
  29. 2 2
      Libraries/LibJS/Runtime/SymbolObject.cpp
  30. 1 1
      Libraries/LibJS/Runtime/SymbolObject.h
  31. 2 2
      Libraries/LibWeb/Bindings/WindowObject.cpp
  32. 1 1
      Libraries/LibWeb/Bindings/WindowObject.h

+ 1 - 1
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);
     }
 };
 

+ 1 - 1
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);

+ 2 - 2
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);
 }
 

+ 1 - 1
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;

+ 2 - 2
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);
 }
 

+ 1 - 1
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;

+ 2 - 2
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);
 }

+ 1 - 1
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
     {

+ 1 - 1
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;

+ 2 - 2
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);
 }
 

+ 1 - 1
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;

+ 2 - 2
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);
 

+ 1 - 1
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; }
 

+ 2 - 2
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);

+ 1 - 1
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);

+ 2 - 2
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);

+ 1 - 1
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 };

+ 2 - 2
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)

+ 1 - 1
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;

+ 2 - 2
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);
 }

+ 1 - 1
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(); }

+ 2 - 2
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);
 }
 

+ 1 - 1
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();
 

+ 4 - 4
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);
     }
 }
 

+ 1 - 1
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;
 

+ 2 - 2
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);
 }
 

+ 1 - 1
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;

+ 1 - 1
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()));

+ 2 - 2
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);
 }
 

+ 1 - 1
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;

+ 2 - 2
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);
 }

+ 1 - 1
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);