diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /js/src/debugger/Frame.cpp | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/debugger/Frame.cpp')
-rw-r--r-- | js/src/debugger/Frame.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/debugger/Frame.cpp b/js/src/debugger/Frame.cpp index 9767e2e7ed..63978b90ab 100644 --- a/js/src/debugger/Frame.cpp +++ b/js/src/debugger/Frame.cpp @@ -439,6 +439,24 @@ void DebuggerFrame::terminate(JS::GCContext* gcx, AbstractFramePtr frame) { gcx->delete_(this, info, MemoryUse::DebuggerFrameGeneratorInfo); } +void DebuggerFrame::onGeneratorClosed(JS::GCContext* gcx) { + GeneratorInfo* info = generatorInfo(); + + // If the generator is closed, eagerly drop the onStep handler, to make sure + // the stepper counter matches in the assertion in DebugAPI::onSingleStep. + // Also clear the slot in order to suppress the decrementStepperCounter in + // DebuggerFrame::terminate. + if (!info->isGeneratorScriptAboutToBeFinalized()) { + JSScript* generatorScript = info->generatorScript(); + OnStepHandler* handler = onStepHandler(); + if (handler) { + decrementStepperCounter(gcx, generatorScript); + setReservedSlot(ONSTEP_HANDLER_SLOT, UndefinedValue()); + handler->drop(gcx, this); + } + } +} + void DebuggerFrame::suspend(JS::GCContext* gcx) { // There must be generator info because otherwise this would be the same // overall behavior as terminate() except that here we do not properly |