Bug 905926 - Remove watchpoints on all compartments during shutdown, not just the cx compartment. r=billm
authorBobby Holley <bobbyholley@gmail.com>
Tue, 17 Sep 2013 09:46:32 -0700
changeset 161331 ecb564ad91402c6995264da35e837f90317d8a34
parent 161330 93dcb6fe927ff9e2cbf85fbaee122a615956bec6
child 161332 021a57afb5050b5b87934fd1faff7b3ba317e679
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs905926
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 905926 - Remove watchpoints on all compartments during shutdown, not just the cx compartment. r=billm
js/public/OldDebugAPI.h
js/src/jscntxt.cpp
js/src/vm/OldDebugAPI.cpp
--- a/js/public/OldDebugAPI.h
+++ b/js/public/OldDebugAPI.h
@@ -186,19 +186,16 @@ JS_SetWatchPoint(JSContext *cx, JSObject
 
 extern JS_PUBLIC_API(bool)
 JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,
                    JSWatchPointHandler *handlerp, JSObject **closurep);
 
 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.
 extern JS_PUBLIC_API(unsigned)
 JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);
 
 extern JS_PUBLIC_API(jsbytecode *)
 JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -31,16 +31,17 @@
 #include "jsiter.h"
 #include "jsobj.h"
 #include "jsopcode.h"
 #include "jsprf.h"
 #include "jspubtd.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jstypes.h"
+#include "jswatchpoint.h"
 #include "jsworkers.h"
 
 #include "gc/Marking.h"
 #ifdef JS_ION
 #include "jit/Ion.h"
 #endif
 #include "js/CharacterEncoding.h"
 #include "js/OldDebugAPI.h"
@@ -265,19 +266,21 @@ js::DestroyContext(JSContext *cx, Destro
         if (rt->workerThreadState)
             rt->workerThreadState->cleanup(rt);
 #endif
 
         /* Unpin all common names before final GC. */
         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();
 
         JS::PrepareForFullGC(rt);
         GC(rt, GC_NORMAL, JS::gcreason::LAST_CONTEXT);
 
         /*
--- a/js/src/vm/OldDebugAPI.cpp
+++ b/js/src/vm/OldDebugAPI.cpp
@@ -368,26 +368,16 @@ JS_ClearWatchPointsForObject(JSContext *
 {
     assertSameCompartment(cx, obj);
 
     if (WatchpointMap *wpmap = cx->compartment()->watchpointMap)
         wpmap->unwatchObject(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)
 JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc)
 {
     return js::PCToLineNumber(script, pc);
 }