Original commit message:
[builtins] Make Promise resolvers not keep resolved Promises alive
Currently a Promise's resolve/reject functions unconditionally hold the
Promise, plus a separate bit to track whether the Promise has been
resolved. Instead, hold a single field with Promise|Undefined.
This allows GC'ing a resolved Promise even if its resolvers are still
alive.
R=olivf@chromium.org
Fixed: 42213031
Change-Id: Ice645dbabb79e63dfcac8ae843cad95439d7a1f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7646250
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Kevin Gibbons <bakkot@gmail.com>
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#108183}
Refs: da20a197a7
Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64101
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>