From 42c719e380e728b5df2f5bd962c9516f0b90e48b Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 17 Sep 2013 09:46:32 -0700 Subject: [PATCH] Bug 905926 - Remove watchpoints on all compartments during shutdown, not just the cx compartment. r=billm --- js/public/OldDebugAPI.h | 3 --- js/src/jscntxt.cpp | 7 +++++-- js/src/vm/OldDebugAPI.cpp | 10 ---------- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/js/public/OldDebugAPI.h b/js/public/OldDebugAPI.h index 91142819407..61cdcf8696b 100644 --- a/js/public/OldDebugAPI.h +++ b/js/public/OldDebugAPI.h @@ -191,9 +191,6 @@ JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id, extern JS_PUBLIC_API(bool) JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj); -extern JS_PUBLIC_API(bool) -JS_ClearAllWatchPoints(JSContext *cx); - /************************************************************************/ // Raw JSScript* because this needs to be callable from a signal handler. diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index 42dff1d6c47..07bae64e836 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -36,6 +36,7 @@ #include "jsscript.h" #include "jsstr.h" #include "jstypes.h" +#include "jswatchpoint.h" #include "jsworkers.h" #include "gc/Marking.h" @@ -270,9 +271,11 @@ js::DestroyContext(JSContext *cx, DestroyContextMode mode) FinishCommonNames(rt); /* Clear debugging state to remove GC roots. */ - for (CompartmentsIter c(rt); !c.done(); c.next()) + for (CompartmentsIter c(rt); !c.done(); c.next()) { c->clearTraps(rt->defaultFreeOp()); - JS_ClearAllWatchPoints(cx); + if (WatchpointMap *wpmap = c->watchpointMap) + wpmap->clear(); + } /* Clear the statics table to remove GC roots. */ rt->staticStrings.finish(); diff --git a/js/src/vm/OldDebugAPI.cpp b/js/src/vm/OldDebugAPI.cpp index 657f465c02c..4cc8fe20791 100644 --- a/js/src/vm/OldDebugAPI.cpp +++ b/js/src/vm/OldDebugAPI.cpp @@ -373,16 +373,6 @@ JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj) return true; } -JS_PUBLIC_API(bool) -JS_ClearAllWatchPoints(JSContext *cx) -{ - if (JSCompartment *comp = cx->compartment()) { - if (WatchpointMap *wpmap = comp->watchpointMap) - wpmap->clear(); - } - return true; -} - /************************************************************************/ JS_PUBLIC_API(unsigned)