1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:37:44 +00:00

AK+LibJS: Introduce JS::HeapFunction

This change introduces HeapFunction, which is intended to be used as a
replacement for SafeFunction. The new type behaves like a regular
GC-allocated object, which means it needs to be visited from
visit_edges, and unlike SafeFunction, it does not create new roots for
captured parameters.

Co-Authored-By: Andreas Kling <kling@serenityos.org>
This commit is contained in:
Aliaksandr Kalenik 2023-08-18 18:21:33 +02:00 committed by Andreas Kling
parent a1ccc4b0cf
commit 469aea5a5b
6 changed files with 183 additions and 42 deletions

View file

@ -82,6 +82,8 @@ public:
{
}
virtual void visit_possible_values(ReadonlyBytes) = 0;
protected:
virtual void visit_impl(Cell&) = 0;
virtual ~Visitor() = default;