diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Heap')
-rw-r--r-- | Userland/Libraries/LibJS/Heap/Cell.h | 9 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Heap/Heap.cpp | 19 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Heap/Heap.h | 11 |
3 files changed, 1 insertions, 38 deletions
diff --git a/Userland/Libraries/LibJS/Heap/Cell.h b/Userland/Libraries/LibJS/Heap/Cell.h index 4e6701e6ca..c7f4a7c645 100644 --- a/Userland/Libraries/LibJS/Heap/Cell.h +++ b/Userland/Libraries/LibJS/Heap/Cell.h @@ -24,18 +24,9 @@ public: bool is_marked() const { return m_mark; } void set_marked(bool b) { m_mark = b; } -#ifdef JS_TRACK_ZOMBIE_CELLS - virtual void did_become_zombie() - { - } -#endif - enum class State { Live, Dead, -#ifdef JS_TRACK_ZOMBIE_CELLS - Zombie, -#endif }; State state() const { return m_state; } diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index cf792ba04a..3fd89637c5 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -190,14 +190,6 @@ public: return; dbgln_if(HEAP_DEBUG, " ! {}", &cell); -#ifdef JS_TRACK_ZOMBIE_CELLS - if (cell.state() == Cell::State::Zombie) { - dbgln("BUG! Marking a zombie cell, {} @ {:p}", cell.class_name(), &cell); - cell.vm().dump_backtrace(); - VERIFY_NOT_REACHED(); - } -#endif - cell.set_marked(true); cell.visit_edges(*this); } @@ -234,16 +226,7 @@ void Heap::sweep_dead_cells(bool print_report, const Core::ElapsedTimer& measure block.template for_each_cell_in_state<Cell::State::Live>([&](Cell* cell) { if (!cell->is_marked()) { dbgln_if(HEAP_DEBUG, " ~ {}", cell); -#ifdef JS_TRACK_ZOMBIE_CELLS - if (m_zombify_dead_cells) { - cell->set_state(Cell::State::Zombie); - cell->did_become_zombie(); - } else { -#endif - block.deallocate(cell); -#ifdef JS_TRACK_ZOMBIE_CELLS - } -#endif + block.deallocate(cell); ++collected_cells; collected_cell_bytes += block.cell_size(); } else { diff --git a/Userland/Libraries/LibJS/Heap/Heap.h b/Userland/Libraries/LibJS/Heap/Heap.h index 6b2deb7335..ddb189581e 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.h +++ b/Userland/Libraries/LibJS/Heap/Heap.h @@ -63,13 +63,6 @@ public: bool should_collect_on_every_allocation() const { return m_should_collect_on_every_allocation; } void set_should_collect_on_every_allocation(bool b) { m_should_collect_on_every_allocation = b; } -#ifdef JS_TRACK_ZOMBIE_CELLS - void set_zombify_dead_cells(bool b) - { - m_zombify_dead_cells = b; - } -#endif - void did_create_handle(Badge<HandleImpl>, HandleImpl&); void did_destroy_handle(Badge<HandleImpl>, HandleImpl&); @@ -132,10 +125,6 @@ private: bool m_should_gc_when_deferral_ends { false }; bool m_collecting_garbage { false }; - -#ifdef JS_TRACK_ZOMBIE_CELLS - bool m_zombify_dead_cells { false }; -#endif }; } |