diff options
Diffstat (limited to 'www/waterfox/files/patch-bug1464872')
| -rw-r--r-- | www/waterfox/files/patch-bug1464872 | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/www/waterfox/files/patch-bug1464872 b/www/waterfox/files/patch-bug1464872 new file mode 100644 index 000000000000..ced4eb742a48 --- /dev/null +++ b/www/waterfox/files/patch-bug1464872 @@ -0,0 +1,96 @@ +commit c5d9b6fb8b07 +Author: Jon Coppeard <jcoppeard@mozilla.com> +Date: Thu May 31 09:27:29 2018 +0100 + + Bug 1464872 - Add forward zone edge for debugger object when calculating sweep groups. r=sfink, a=RyanVM + + --HG-- + extra : rebase_source : 4bef781c44aec09e4e8cd13b4131f26548a9f5dc + extra : source : 2d1e3d80489de3ac0ab0fef04f20cee5b117cbac +--- + js/src/jit-test/tests/gc/bug-1464872.js | 14 ++++++++++ + js/src/vm/Debugger.cpp | 47 +++++++++++++++++++++------------ + 2 files changed, 44 insertions(+), 17 deletions(-) + +diff --git js/src/jit-test/tests/gc/bug-1464872.js js/src/jit-test/tests/gc/bug-1464872.js +new file mode 100644 +index 0000000000000..433e4a1314ce5 +--- /dev/null ++++ js/src/jit-test/tests/gc/bug-1464872.js +@@ -0,0 +1,14 @@ ++var g = newGlobal(); ++var dbg = Debugger(g); ++dbg.onEnterFrame = function(frame) {}; ++ ++var g2 = newGlobal(); ++g2[g] = g; ++g2.evaluate("grayRoot()") ++g2 = undefined; ++ ++g = undefined; ++dbg = undefined; ++ ++gc(); ++startgc(100000); +diff --git js/src/vm/Debugger.cpp js/src/vm/Debugger.cpp +index 09b82b9a60d48..26afc6e84f4b4 100644 +--- js/src/vm/Debugger.cpp ++++ js/src/vm/Debugger.cpp +@@ -3282,26 +3282,39 @@ Debugger::detachAllDebuggersFromGlobal(FreeOp* fop, GlobalObject* global) + /* static */ void + Debugger::findZoneEdges(Zone* zone, js::gc::ZoneComponentFinder& finder) + { +- /* +- * For debugger cross compartment wrappers, add edges in the opposite +- * direction to those already added by JSCompartment::findOutgoingEdges. +- * This ensure that debuggers and their debuggees are finalized in the same +- * group. +- */ + for (ZoneGroupsIter group(zone->runtimeFromActiveCooperatingThread()); !group.done(); group.next()) { + for (Debugger* dbg : group->debuggerList()) { +- Zone* w = dbg->object->zone(); +- if (w == zone || !w->isGCMarking()) +- continue; +- if (dbg->debuggeeZones.has(zone) || +- dbg->scripts.hasKeyInZone(zone) || +- dbg->sources.hasKeyInZone(zone) || +- dbg->objects.hasKeyInZone(zone) || +- dbg->environments.hasKeyInZone(zone) || +- dbg->wasmInstanceScripts.hasKeyInZone(zone) || +- dbg->wasmInstanceSources.hasKeyInZone(zone)) +- { +- finder.addEdgeTo(w); ++ Zone* debuggerZone = dbg->object->zone(); ++ if (!debuggerZone->isGCMarking()) ++ continue; ++ ++ if (debuggerZone == zone) { ++ /* ++ * Add edges to debuggee zones. These are weak references that are ++ * not in the cross compartment wrapper map. ++ */ ++ for (auto e = dbg->debuggeeZones.all(); !e.empty(); e.popFront()) { ++ Zone* debuggeeZone = e.front(); ++ if (debuggeeZone->isGCMarking()) ++ finder.addEdgeTo(debuggeeZone); ++ } ++ } else { ++ /* ++ * For debugger cross compartment wrappers, add edges in the ++ * opposite direction to those already added by ++ * JSCompartment::findOutgoingEdges and above. This ensure that ++ * debuggers and their debuggees are finalized in the same group. ++ */ ++ if (dbg->debuggeeZones.has(zone) || ++ dbg->scripts.hasKeyInZone(zone) || ++ dbg->sources.hasKeyInZone(zone) || ++ dbg->objects.hasKeyInZone(zone) || ++ dbg->environments.hasKeyInZone(zone) || ++ dbg->wasmInstanceScripts.hasKeyInZone(zone) || ++ dbg->wasmInstanceSources.hasKeyInZone(zone)) ++ { ++ finder.addEdgeTo(debuggerZone); ++ } + } + } + } |
