Part 2 - Purge first continuation cache for next continuations during frame destruction.
This patch attempts another approach to avoid the O(n^2) time complexity of
updating the first-continuation cache when removing a frame's continuation chain
from front to back.
Assume F1, F2, and F3 are the first three continuations in the chain. When we
call F2->SetPrevContinuation(nullptr)
to disconnect F1 from the chain, we now
purge the first-continuation cache for F2's next-continuations rather than
updating their cache value to F2.
At the time when we call F3->SetPrevContinuation(nullptr)
to disconnect F2
from the chain, F3's next-continuations no longer have the cache. Therefor, we
don't need to do extra work to walk the next-continuations.
Because the first-continuation cache might not exist during the frame
destruction, this patch reintroduce the slow path to walk the prev-continuation
chain to reach the first-continuation.
Differential Revision: https://phabricator.services.mozilla.com/D214659
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1903652
gecko-commit: 46b26e2046605eeda18e19a69c5f67259a3c8563
gecko-reviewers: dholbert