diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-21 13:47:33 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-21 14:34:40 +0200 |
commit | fbe290751067b52770ead18ff6f06bccc55e2c98 (patch) | |
tree | 73a256c8de5df3e01c87fb9b048a6029d9f64fa1 /Libraries/LibJS/Heap/Heap.cpp | |
parent | 31bb107922f8c869bfecb348288a7e4dc74d8937 (diff) | |
download | serenity-fbe290751067b52770ead18ff6f06bccc55e2c98.zip |
LibJS: GC should gather roots from all active interpreters
If we are in a nested execution context, we shouldn't only mark things
used by the active interpreter.
Diffstat (limited to 'Libraries/LibJS/Heap/Heap.cpp')
-rw-r--r-- | Libraries/LibJS/Heap/Heap.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Libraries/LibJS/Heap/Heap.cpp b/Libraries/LibJS/Heap/Heap.cpp index 9f9cb02c15..a4a131fe5c 100644 --- a/Libraries/LibJS/Heap/Heap.cpp +++ b/Libraries/LibJS/Heap/Heap.cpp @@ -105,9 +105,7 @@ void Heap::collect_garbage(CollectionType collection_type, bool print_report) void Heap::gather_roots(HashTable<Cell*>& roots) { - if (auto* interpreter = vm().interpreter_if_exists()) - interpreter->gather_roots({}, roots); - + vm().gather_roots(roots); gather_conservative_roots(roots); for (auto* handle : m_handles) |