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/Debugger.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/Debugger.cpp')
-rw-r--r-- | js/src/debugger/Debugger.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/js/src/debugger/Debugger.cpp b/js/src/debugger/Debugger.cpp index 8a99f8d4fe..37c1e79a9d 100644 --- a/js/src/debugger/Debugger.cpp +++ b/js/src/debugger/Debugger.cpp @@ -1794,7 +1794,7 @@ static bool CheckResumptionValue(JSContext* cx, AbstractFramePtr frame, } // 2. The generator must be closed. - genObj->setClosed(); + genObj->setClosed(cx); // Async generators have additionally bookkeeping which must be adjusted // when switching over to the closed state. @@ -1823,7 +1823,7 @@ static bool CheckResumptionValue(JSContext* cx, AbstractFramePtr frame, vp.setObject(*promise); // 2. The generator must be closed. - generator->setClosed(); + generator->setClosed(cx); } else { // We're before entering the actual function code. @@ -2855,6 +2855,20 @@ void DebugAPI::slowPathOnNewGlobalObject(JSContext* cx, } /* static */ +void DebugAPI::slowPathOnGeneratorClosed(JSContext* cx, + AbstractGeneratorObject* genObj) { + JS::AutoAssertNoGC nogc; + for (Realm::DebuggerVectorEntry& entry : cx->global()->getDebuggers(nogc)) { + Debugger* dbg = entry.dbg; + if (Debugger::GeneratorWeakMap::Ptr frameEntry = + dbg->generatorFrames.lookup(genObj)) { + DebuggerFrame* frameObj = frameEntry->value(); + frameObj->onGeneratorClosed(cx->gcContext()); + } + } +} + +/* static */ void DebugAPI::slowPathNotifyParticipatesInGC(uint64_t majorGCNumber, Realm::DebuggerVector& dbgs, const JS::AutoRequireNoGC& nogc) { |