LibJS: Stop having AsyncFunctionDriverWrapper leak itself

Async functions whose promise is never resolved were leaking, since they
had a strong root JS::Handle on themselves.

This doesn't appear to actually be necessary, since the wrapper will be
kept alive as long as it's reachable (and if it's not reachable, nobody
is going to resolve/reject the promise either).

This fixes the vast majority of leaks on Speedometer, bringing memory
usage at the end of a full run from ~12 GiB to ~3 GiB.
This commit is contained in:
Andreas Kling 2024-11-12 15:38:37 +01:00 committed by Andreas Kling
commit b6a5b7e186
Notes: github-actions[bot] 2024-11-12 16:39:22 +00:00
2 changed files with 1 additions and 11 deletions

View file

@ -38,7 +38,6 @@ private:
NonnullGCPtr<GeneratorObject> m_generator_object;
NonnullGCPtr<Promise> m_top_level_promise;
GCPtr<Promise> m_current_promise { nullptr };
Handle<AsyncFunctionDriverWrapper> m_self_handle;
OwnPtr<ExecutionContext> m_suspended_execution_context;
};