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" :^)
This commit is contained in:
parent
8dc6416bba
commit
f1f14945cf
Notes:
sideshowbarker
2024-07-19 08:17:49 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f1f14945cff
4 changed files with 6 additions and 6 deletions
|
@ -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:";
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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&);
|
||||
|
|
Loading…
Add table
Reference in a new issue