Mark our saved setter in case we have the last reference to it. bug 361346, r=brendan

git-svn-id: svn://10.0.0.236/trunk@215787 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2006-11-24 18:57:34 +00:00
parent 6827a657d1
commit 3222b6c4b2
3 changed files with 7 additions and 3 deletions

View File

@@ -279,14 +279,18 @@ DropWatchPoint(JSContext *cx, JSWatchPoint *wp)
}
void
js_MarkWatchPoints(JSRuntime *rt)
js_MarkWatchPoints(JSContext *cx)
{
JSRuntime *rt;
JSWatchPoint *wp;
rt = cx->runtime;
for (wp = (JSWatchPoint *)rt->watchPointList.next;
wp != (JSWatchPoint *)&rt->watchPointList;
wp = (JSWatchPoint *)wp->links.next) {
MARK_SCOPE_PROPERTY(wp->sprop);
if (wp->sprop->attrs & JSPROP_SETTER)
JS_MarkGCThing(cx, wp->setter, "wp->setter", NULL);
}
}

View File

@@ -99,7 +99,7 @@ JS_ClearAllWatchPoints(JSContext *cx);
* header file "jsconfig.h" has been included.
*/
extern void
js_MarkWatchPoints(JSRuntime *rt);
js_MarkWatchPoints(JSContext *cx);
extern JSScopeProperty *
js_FindWatchPoint(JSRuntime *rt, JSScope *scope, jsid id);

View File

@@ -2849,7 +2849,7 @@ restart:
if (rt->gcLocksHash)
JS_DHashTableEnumerate(rt->gcLocksHash, gc_lock_marker, cx);
js_MarkAtomState(&rt->atomState, keepAtoms, gc_mark_atom_key_thing, cx);
js_MarkWatchPoints(rt);
js_MarkWatchPoints(cx);
js_MarkScriptFilenames(rt, keepAtoms);
js_MarkNativeIteratorStates(cx);