mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 18:27:40 +00:00
LibJS: Make Cell::Visitor::visit_impl() take a Cell&
Passing a null cell pointer is not supported.
This commit is contained in:
parent
789d20ebb7
commit
0de954e86b
3 changed files with 7 additions and 7 deletions
|
@ -41,12 +41,12 @@ public:
|
||||||
void visit(Cell* cell)
|
void visit(Cell* cell)
|
||||||
{
|
{
|
||||||
if (cell)
|
if (cell)
|
||||||
visit_impl(cell);
|
visit_impl(*cell);
|
||||||
}
|
}
|
||||||
void visit(Value);
|
void visit(Value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visit_impl(Cell*) = 0;
|
virtual void visit_impl(Cell&) = 0;
|
||||||
virtual ~Visitor() = default;
|
virtual ~Visitor() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -155,13 +155,13 @@ class MarkingVisitor final : public Cell::Visitor {
|
||||||
public:
|
public:
|
||||||
MarkingVisitor() { }
|
MarkingVisitor() { }
|
||||||
|
|
||||||
virtual void visit_impl(Cell* cell)
|
virtual void visit_impl(Cell& cell)
|
||||||
{
|
{
|
||||||
if (cell->is_marked())
|
if (cell.is_marked())
|
||||||
return;
|
return;
|
||||||
dbgln_if(HEAP_DEBUG, " ! {}", cell);
|
dbgln_if(HEAP_DEBUG, " ! {}", cell);
|
||||||
cell->set_marked(true);
|
cell.set_marked(true);
|
||||||
cell->visit_edges(*this);
|
cell.visit_edges(*this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -330,7 +330,7 @@ inline Value js_negative_infinity()
|
||||||
inline void Cell::Visitor::visit(Value value)
|
inline void Cell::Visitor::visit(Value value)
|
||||||
{
|
{
|
||||||
if (value.is_cell())
|
if (value.is_cell())
|
||||||
visit_impl(value.as_cell());
|
visit_impl(*value.as_cell());
|
||||||
}
|
}
|
||||||
|
|
||||||
Value greater_than(GlobalObject&, Value lhs, Value rhs);
|
Value greater_than(GlobalObject&, Value lhs, Value rhs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue