Bug 690970, part 2: unmark gray read barrier for watchpoints. r=billm

This commit is contained in:
Andrew McCreight 2013-01-08 10:36:51 -08:00
Родитель f35a0a52f1
Коммит 2e37bd40a8
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -93,8 +93,12 @@ WatchpointMap::unwatch(JSObject *obj, jsid id,
if (Map::Ptr p = map.lookup(WatchKey(obj, id))) {
if (handlerp)
*handlerp = p->value.handler;
if (closurep)
if (closurep) {
// Read barrier to prevent an incorrectly gray closure from escaping the
// watchpoint. See the comment before UnmarkGrayChildren in gc/Marking.cpp
ExposeGCThingToActiveJS(p->value.closure, JSTRACE_OBJECT);
*closurep = p->value.closure;
}
map.remove(p);
}
}
@ -138,6 +142,10 @@ WatchpointMap::triggerWatchpoint(JSContext *cx, HandleObject obj, HandleId id, M
}
}
// Read barrier to prevent an incorrectly gray closure from escaping the
// watchpoint. See the comment before UnmarkGrayChildren in gc/Marking.cpp
ExposeGCThingToActiveJS(closure, JSTRACE_OBJECT);
/* Call the handler. */
return handler(cx, obj, id, old, vp.address(), closure);
}