Bug 905926 - Remove watchpoints on all compartments during shutdown, not just the cx compartment. r=billm

This commit is contained in:
Bobby Holley 2013-09-17 09:46:32 -07:00
parent ac7034ec92
commit 42c719e380
3 changed files with 5 additions and 15 deletions

View File

@ -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.

View File

@ -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();

View File

@ -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)