From cd53d046b25f7a38b2bf0cf9e38db3762ca79819 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 27 Jun 2021 22:39:48 +0200 Subject: [PATCH] LibJS: Fix typo "sweeped" => "swept" everywhere --- Userland/Libraries/LibJS/Heap/Heap.cpp | 10 +++++----- .../Libraries/LibJS/Runtime/FinalizationRegistry.cpp | 8 ++++---- .../Libraries/LibJS/Runtime/FinalizationRegistry.h | 2 +- Userland/Libraries/LibJS/Runtime/WeakContainer.h | 2 +- Userland/Libraries/LibJS/Runtime/WeakMap.cpp | 2 +- Userland/Libraries/LibJS/Runtime/WeakMap.h | 2 +- Userland/Libraries/LibJS/Runtime/WeakRef.cpp | 2 +- Userland/Libraries/LibJS/Runtime/WeakRef.h | 2 +- Userland/Libraries/LibJS/Runtime/WeakSet.cpp | 2 +- Userland/Libraries/LibJS/Runtime/WeakSet.h | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index 8b807ff606d..c1ee023ecbb 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -183,22 +183,22 @@ void Heap::sweep_dead_cells(bool print_report, const Core::ElapsedTimer& measure dbgln_if(HEAP_DEBUG, "sweep_dead_cells:"); Vector empty_blocks; Vector full_blocks_that_became_usable; - Vector sweeped_cells; + Vector swept_cells; size_t collected_cells = 0; size_t live_cells = 0; size_t collected_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) { bool block_has_live_cells = false; bool block_was_full = block.is_full(); block.template for_each_cell_in_state([&](Cell* cell) { if (!cell->is_marked()) { dbgln_if(HEAP_DEBUG, " ~ {}", cell); - if (should_store_sweeped_cells) - sweeped_cells.append(cell); + if (should_store_swept_cells) + swept_cells.append(cell); block.deallocate(cell); ++collected_cells; 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) - weak_container->remove_sweeped_cells({}, sweeped_cells); + weak_container->remove_swept_cells({}, swept_cells); if constexpr (HEAP_DEBUG) { for_each_block([&](auto& block) { diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp index d4dad7c5b2f..9e012043d6b 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp @@ -42,19 +42,19 @@ bool FinalizationRegistry::remove_by_token(Object& unregister_token) return removed; } -void FinalizationRegistry::remove_sweeped_cells(Badge, Vector& cells) +void FinalizationRegistry::remove_swept_cells(Badge, Vector& cells) { - auto any_cells_were_sweeped = false; + auto any_cells_were_swept = false; for (auto cell : cells) { for (auto& record : m_records) { if (record.target != cell) continue; record.target = nullptr; - any_cells_were_sweeped = true; + any_cells_were_swept = true; break; } } - if (any_cells_were_sweeped) + if (any_cells_were_swept) vm().enqueue_finalization_registry_cleanup_job(*this); } diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h index 7b403dc5836..8753f0838c7 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h @@ -30,7 +30,7 @@ public: bool remove_by_token(Object& unregister_token); void cleanup(FunctionObject* callback = nullptr); - virtual void remove_sweeped_cells(Badge, Vector&) override; + virtual void remove_swept_cells(Badge, Vector&) override; private: virtual void visit_edges(Visitor& visitor) override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakContainer.h b/Userland/Libraries/LibJS/Runtime/WeakContainer.h index 493f4fde51d..fe49325fd1d 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakContainer.h +++ b/Userland/Libraries/LibJS/Runtime/WeakContainer.h @@ -22,7 +22,7 @@ public: deregister(); } - virtual void remove_sweeped_cells(Badge, Vector&) = 0; + virtual void remove_swept_cells(Badge, Vector&) = 0; protected: void deregister() diff --git a/Userland/Libraries/LibJS/Runtime/WeakMap.cpp b/Userland/Libraries/LibJS/Runtime/WeakMap.cpp index 00cff84e514..d689bb5a970 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMap.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMap.cpp @@ -23,7 +23,7 @@ WeakMap::~WeakMap() { } -void WeakMap::remove_sweeped_cells(Badge, Vector& cells) +void WeakMap::remove_swept_cells(Badge, Vector& cells) { for (auto* cell : cells) m_values.remove(cell); diff --git a/Userland/Libraries/LibJS/Runtime/WeakMap.h b/Userland/Libraries/LibJS/Runtime/WeakMap.h index e0673279786..e530cb95c10 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMap.h +++ b/Userland/Libraries/LibJS/Runtime/WeakMap.h @@ -27,7 +27,7 @@ public: HashMap const& values() const { return m_values; }; HashMap& values() { return m_values; }; - virtual void remove_sweeped_cells(Badge, Vector&) override; + virtual void remove_swept_cells(Badge, Vector&) override; private: HashMap m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping diff --git a/Userland/Libraries/LibJS/Runtime/WeakRef.cpp b/Userland/Libraries/LibJS/Runtime/WeakRef.cpp index 906257550c1..868cea84576 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRef.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRef.cpp @@ -25,7 +25,7 @@ WeakRef::~WeakRef() { } -void WeakRef::remove_sweeped_cells(Badge, Vector& cells) +void WeakRef::remove_swept_cells(Badge, Vector& cells) { VERIFY(m_value); for (auto* cell : cells) { diff --git a/Userland/Libraries/LibJS/Runtime/WeakRef.h b/Userland/Libraries/LibJS/Runtime/WeakRef.h index cd828c21f79..91c2ddb5511 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRef.h +++ b/Userland/Libraries/LibJS/Runtime/WeakRef.h @@ -27,7 +27,7 @@ public: void update_execution_generation() { m_last_execution_generation = vm().execution_generation(); }; - virtual void remove_sweeped_cells(Badge, Vector&) override; + virtual void remove_swept_cells(Badge, Vector&) override; private: virtual void visit_edges(Visitor&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakSet.cpp b/Userland/Libraries/LibJS/Runtime/WeakSet.cpp index 5e028752706..ebf717ffc6f 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSet.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSet.cpp @@ -23,7 +23,7 @@ WeakSet::~WeakSet() { } -void WeakSet::remove_sweeped_cells(Badge, Vector& cells) +void WeakSet::remove_swept_cells(Badge, Vector& cells) { for (auto* cell : cells) m_values.remove(cell); diff --git a/Userland/Libraries/LibJS/Runtime/WeakSet.h b/Userland/Libraries/LibJS/Runtime/WeakSet.h index 8e0719ca6b2..80bcba5708e 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSet.h +++ b/Userland/Libraries/LibJS/Runtime/WeakSet.h @@ -27,7 +27,7 @@ public: HashTable const& values() const { return m_values; }; HashTable& values() { return m_values; }; - virtual void remove_sweeped_cells(Badge, Vector&) override; + virtual void remove_swept_cells(Badge, Vector&) override; private: HashTable m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping