1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:57:47 +00:00

LibJS: Fix typo "sweeped" => "swept" everywhere

This commit is contained in:
Andreas Kling 2021-06-27 22:39:48 +02:00
parent 1bd52ce789
commit cd53d046b2
10 changed files with 17 additions and 17 deletions

View file

@ -183,22 +183,22 @@ void Heap::sweep_dead_cells(bool print_report, const Core::ElapsedTimer& measure
dbgln_if(HEAP_DEBUG, "sweep_dead_cells:"); dbgln_if(HEAP_DEBUG, "sweep_dead_cells:");
Vector<HeapBlock*, 32> empty_blocks; Vector<HeapBlock*, 32> empty_blocks;
Vector<HeapBlock*, 32> full_blocks_that_became_usable; Vector<HeapBlock*, 32> full_blocks_that_became_usable;
Vector<Cell*> sweeped_cells; Vector<Cell*> swept_cells;
size_t collected_cells = 0; size_t collected_cells = 0;
size_t live_cells = 0; size_t live_cells = 0;
size_t collected_cell_bytes = 0; size_t collected_cell_bytes = 0;
size_t live_cell_bytes = 0; size_t live_cell_bytes = 0;
auto should_store_sweeped_cells = !m_weak_containers.is_empty(); auto should_store_swept_cells = !m_weak_containers.is_empty();
for_each_block([&](auto& block) { for_each_block([&](auto& block) {
bool block_has_live_cells = false; bool block_has_live_cells = false;
bool block_was_full = block.is_full(); bool block_was_full = block.is_full();
block.template for_each_cell_in_state<Cell::State::Live>([&](Cell* cell) { block.template for_each_cell_in_state<Cell::State::Live>([&](Cell* cell) {
if (!cell->is_marked()) { if (!cell->is_marked()) {
dbgln_if(HEAP_DEBUG, " ~ {}", cell); dbgln_if(HEAP_DEBUG, " ~ {}", cell);
if (should_store_sweeped_cells) if (should_store_swept_cells)
sweeped_cells.append(cell); swept_cells.append(cell);
block.deallocate(cell); block.deallocate(cell);
++collected_cells; ++collected_cells;
collected_cell_bytes += block.cell_size(); collected_cell_bytes += block.cell_size();
@ -227,7 +227,7 @@ void Heap::sweep_dead_cells(bool print_report, const Core::ElapsedTimer& measure
} }
for (auto* weak_container : m_weak_containers) for (auto* weak_container : m_weak_containers)
weak_container->remove_sweeped_cells({}, sweeped_cells); weak_container->remove_swept_cells({}, swept_cells);
if constexpr (HEAP_DEBUG) { if constexpr (HEAP_DEBUG) {
for_each_block([&](auto& block) { for_each_block([&](auto& block) {

View file

@ -42,19 +42,19 @@ bool FinalizationRegistry::remove_by_token(Object& unregister_token)
return removed; return removed;
} }
void FinalizationRegistry::remove_sweeped_cells(Badge<Heap>, Vector<Cell*>& cells) void FinalizationRegistry::remove_swept_cells(Badge<Heap>, Vector<Cell*>& cells)
{ {
auto any_cells_were_sweeped = false; auto any_cells_were_swept = false;
for (auto cell : cells) { for (auto cell : cells) {
for (auto& record : m_records) { for (auto& record : m_records) {
if (record.target != cell) if (record.target != cell)
continue; continue;
record.target = nullptr; record.target = nullptr;
any_cells_were_sweeped = true; any_cells_were_swept = true;
break; break;
} }
} }
if (any_cells_were_sweeped) if (any_cells_were_swept)
vm().enqueue_finalization_registry_cleanup_job(*this); vm().enqueue_finalization_registry_cleanup_job(*this);
} }

View file

@ -30,7 +30,7 @@ public:
bool remove_by_token(Object& unregister_token); bool remove_by_token(Object& unregister_token);
void cleanup(FunctionObject* callback = nullptr); void cleanup(FunctionObject* callback = nullptr);
virtual void remove_sweeped_cells(Badge<Heap>, Vector<Cell*>&) override; virtual void remove_swept_cells(Badge<Heap>, Vector<Cell*>&) override;
private: private:
virtual void visit_edges(Visitor& visitor) override; virtual void visit_edges(Visitor& visitor) override;

View file

@ -22,7 +22,7 @@ public:
deregister(); deregister();
} }
virtual void remove_sweeped_cells(Badge<Heap>, Vector<Cell*>&) = 0; virtual void remove_swept_cells(Badge<Heap>, Vector<Cell*>&) = 0;
protected: protected:
void deregister() void deregister()

View file

@ -23,7 +23,7 @@ WeakMap::~WeakMap()
{ {
} }
void WeakMap::remove_sweeped_cells(Badge<Heap>, Vector<Cell*>& cells) void WeakMap::remove_swept_cells(Badge<Heap>, Vector<Cell*>& cells)
{ {
for (auto* cell : cells) for (auto* cell : cells)
m_values.remove(cell); m_values.remove(cell);

View file

@ -27,7 +27,7 @@ public:
HashMap<Cell*, Value> const& values() const { return m_values; }; HashMap<Cell*, Value> const& values() const { return m_values; };
HashMap<Cell*, Value>& values() { return m_values; }; HashMap<Cell*, Value>& values() { return m_values; };
virtual void remove_sweeped_cells(Badge<Heap>, Vector<Cell*>&) override; virtual void remove_swept_cells(Badge<Heap>, Vector<Cell*>&) override;
private: private:
HashMap<Cell*, Value> m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping HashMap<Cell*, Value> m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping

View file

@ -25,7 +25,7 @@ WeakRef::~WeakRef()
{ {
} }
void WeakRef::remove_sweeped_cells(Badge<Heap>, Vector<Cell*>& cells) void WeakRef::remove_swept_cells(Badge<Heap>, Vector<Cell*>& cells)
{ {
VERIFY(m_value); VERIFY(m_value);
for (auto* cell : cells) { for (auto* cell : cells) {

View file

@ -27,7 +27,7 @@ public:
void update_execution_generation() { m_last_execution_generation = vm().execution_generation(); }; void update_execution_generation() { m_last_execution_generation = vm().execution_generation(); };
virtual void remove_sweeped_cells(Badge<Heap>, Vector<Cell*>&) override; virtual void remove_swept_cells(Badge<Heap>, Vector<Cell*>&) override;
private: private:
virtual void visit_edges(Visitor&) override; virtual void visit_edges(Visitor&) override;

View file

@ -23,7 +23,7 @@ WeakSet::~WeakSet()
{ {
} }
void WeakSet::remove_sweeped_cells(Badge<Heap>, Vector<Cell*>& cells) void WeakSet::remove_swept_cells(Badge<Heap>, Vector<Cell*>& cells)
{ {
for (auto* cell : cells) for (auto* cell : cells)
m_values.remove(cell); m_values.remove(cell);

View file

@ -27,7 +27,7 @@ public:
HashTable<Cell*> const& values() const { return m_values; }; HashTable<Cell*> const& values() const { return m_values; };
HashTable<Cell*>& values() { return m_values; }; HashTable<Cell*>& values() { return m_values; };
virtual void remove_sweeped_cells(Badge<Heap>, Vector<Cell*>&) override; virtual void remove_swept_cells(Badge<Heap>, Vector<Cell*>&) override;
private: private:
HashTable<Cell*> m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping HashTable<Cell*> m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping