Files
ladybird/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp
Aliaksandr Kalenik 4182952090 LibJS: Replace PromiseResolvingFunction closure with a Kind enum
Every Promise allocates two PromiseResolvingFunction cells (resolve and
reject). Each cell stored an AK::Function holding a closure, but neither
closure captured anything beyond the Promise and AlreadyResolved already
present as cell fields.

Hoist the two closure bodies into static functions on Promise and
dispatch by a Kind enum on the cell. This removes the AK::Function
storage embedded in each cell along with its off-GC malloc'd closure
capture.
2026-04-30 20:22:54 +02:00

1.6 KiB