mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:17:35 +00:00
LibJS: Remove the JS_TRACK_ZOMBIE_CELLS option
This feature had bitrotted somewhat and would trigger errors because PrimitiveStrings were "destroyed" but because of this mode they were not removed from the string cache. Even fixing that case running test-js with the options still failed in more places.
This commit is contained in:
parent
794d79e315
commit
8da6c01d8f
13 changed files with 1 additions and 107 deletions
|
@ -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; }
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -35,13 +35,6 @@ public:
|
|||
private:
|
||||
virtual void visit_edges(Visitor& visitor) override;
|
||||
|
||||
#ifdef JS_TRACK_ZOMBIE_CELLS
|
||||
virtual void did_become_zombie() override
|
||||
{
|
||||
deregister();
|
||||
}
|
||||
#endif
|
||||
|
||||
FunctionObject* m_cleanup_callback { nullptr };
|
||||
|
||||
struct FinalizationRecord {
|
||||
|
|
|
@ -247,11 +247,4 @@ FLATTEN void Shape::add_property_without_transition(PropertyKey const& property_
|
|||
add_property_without_transition(property_name.to_string_or_symbol(), attributes);
|
||||
}
|
||||
|
||||
#ifdef JS_TRACK_ZOMBIE_CELLS
|
||||
void Shape::did_become_zombie()
|
||||
{
|
||||
revoke_weak_ptrs();
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -89,10 +89,6 @@ private:
|
|||
virtual const char* class_name() const override { return "Shape"; }
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
#ifdef JS_TRACK_ZOMBIE_CELLS
|
||||
virtual void did_become_zombie() override;
|
||||
#endif
|
||||
|
||||
Shape* get_or_prune_cached_forward_transition(TransitionKey const&);
|
||||
Shape* get_or_prune_cached_prototype_transition(Object* prototype);
|
||||
|
||||
|
|
|
@ -30,13 +30,6 @@ public:
|
|||
virtual void remove_dead_cells(Badge<Heap>) override;
|
||||
|
||||
private:
|
||||
#ifdef JS_TRACK_ZOMBIE_CELLS
|
||||
virtual void did_become_zombie() override
|
||||
{
|
||||
deregister();
|
||||
}
|
||||
#endif
|
||||
|
||||
void visit_edges(Visitor&) override;
|
||||
|
||||
HashMap<Cell*, Value> m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping
|
||||
|
|
|
@ -32,13 +32,6 @@ public:
|
|||
private:
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
#ifdef JS_TRACK_ZOMBIE_CELLS
|
||||
virtual void did_become_zombie() override
|
||||
{
|
||||
deregister();
|
||||
}
|
||||
#endif
|
||||
|
||||
Object* m_value { nullptr };
|
||||
u32 m_last_execution_generation { 0 };
|
||||
};
|
||||
|
|
|
@ -30,13 +30,6 @@ public:
|
|||
virtual void remove_dead_cells(Badge<Heap>) override;
|
||||
|
||||
private:
|
||||
#ifdef JS_TRACK_ZOMBIE_CELLS
|
||||
virtual void did_become_zombie() override
|
||||
{
|
||||
deregister();
|
||||
}
|
||||
#endif
|
||||
|
||||
HashTable<Cell*> m_values; // This stores Cell pointers instead of Object pointers to aide with sweeping
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue