summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Heap/Cell.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-25 18:17:41 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-25 18:18:48 +0200
commit91656d63c7fd5b75dc4edef26591b8a97ce02b8b (patch)
treede70be4d59c3dde06b2e20f54bb3563fca5bf789 /Userland/Libraries/LibJS/Heap/Cell.h
parentc81b3e1ee3c005f1703f8a9e47b53b3ed836fc32 (diff)
downloadserenity-91656d63c7fd5b75dc4edef26591b8a97ce02b8b.zip
LibJS: Inline Cell::Visitor::visit() functions
This allows the calls to MarkingVisitor::visit_impl() during GC to be devirtualized in Heap::mark_live_cells().
Diffstat (limited to 'Userland/Libraries/LibJS/Heap/Cell.h')
-rw-r--r--Userland/Libraries/LibJS/Heap/Cell.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Heap/Cell.h b/Userland/Libraries/LibJS/Heap/Cell.h
index bc0e6a9e23..d5d61ca442 100644
--- a/Userland/Libraries/LibJS/Heap/Cell.h
+++ b/Userland/Libraries/LibJS/Heap/Cell.h
@@ -33,7 +33,11 @@ public:
class Visitor {
public:
- void visit(Cell*);
+ void visit(Cell* cell)
+ {
+ if (cell)
+ visit_impl(cell);
+ }
void visit(Value);
protected: