diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-15 15:12:34 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-15 15:13:24 +0100 |
commit | f1f14945cffd70a177e852ac7d9d97adfd813350 (patch) | |
tree | 09d61850dd32774344d91554a6291e52c157a220 /Libraries | |
parent | 8dc6416bbadfadec000ffeac6559caaeda14569b (diff) | |
download | serenity-f1f14945cffd70a177e852ac7d9d97adfd813350.zip |
LibJS: Rename collect_roots() => gather_roots()
Since this is about finding the things we should *not* garabge collect,
it seemed wrong to call it "collect_something" :^)
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibJS/Heap.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibJS/Heap.h | 2 | ||||
-rw-r--r-- | Libraries/LibJS/Interpreter.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibJS/Interpreter.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/Libraries/LibJS/Heap.cpp b/Libraries/LibJS/Heap.cpp index c7419f4d0d..84a7c7b371 100644 --- a/Libraries/LibJS/Heap.cpp +++ b/Libraries/LibJS/Heap.cpp @@ -62,14 +62,14 @@ Cell* Heap::allocate_cell(size_t size) void Heap::collect_garbage() { HashTable<Cell*> roots; - collect_roots(roots); + gather_roots(roots); mark_live_cells(roots); sweep_dead_cells(); } -void Heap::collect_roots(HashTable<Cell*>& roots) +void Heap::gather_roots(HashTable<Cell*>& roots) { - m_interpreter.collect_roots({}, roots); + m_interpreter.gather_roots({}, roots); #ifdef HEAP_DEBUG dbg() << "collect_roots:"; diff --git a/Libraries/LibJS/Heap.h b/Libraries/LibJS/Heap.h index 2b27d15923..e70d28fa95 100644 --- a/Libraries/LibJS/Heap.h +++ b/Libraries/LibJS/Heap.h @@ -58,7 +58,7 @@ public: private: Cell* allocate_cell(size_t); - void collect_roots(HashTable<Cell*>&); + void gather_roots(HashTable<Cell*>&); void mark_live_cells(const HashTable<Cell*>& live_cells); void sweep_dead_cells(); diff --git a/Libraries/LibJS/Interpreter.cpp b/Libraries/LibJS/Interpreter.cpp index 903f7fbc9f..c7ceb8eba3 100644 --- a/Libraries/LibJS/Interpreter.cpp +++ b/Libraries/LibJS/Interpreter.cpp @@ -136,7 +136,7 @@ Value Interpreter::get_variable(const String& name) return global_object().get(name); } -void Interpreter::collect_roots(Badge<Heap>, HashTable<Cell*>& roots) +void Interpreter::gather_roots(Badge<Heap>, HashTable<Cell*>& roots) { roots.set(m_global_object); roots.set(m_string_prototype); diff --git a/Libraries/LibJS/Interpreter.h b/Libraries/LibJS/Interpreter.h index 305e6a105e..ca6ad60409 100644 --- a/Libraries/LibJS/Interpreter.h +++ b/Libraries/LibJS/Interpreter.h @@ -74,7 +74,7 @@ public: void set_variable(String name, Value); void declare_variable(String name, DeclarationType); - void collect_roots(Badge<Heap>, HashTable<Cell*>&); + void gather_roots(Badge<Heap>, HashTable<Cell*>&); void enter_scope(const ScopeNode&, Vector<Argument>, ScopeType); void exit_scope(const ScopeNode&); |