зеркало из https://github.com/mozilla/pjs.git
Backout bug 653248 due to bug 667011
This commit is contained in:
Родитель
1a60ab9296
Коммит
88849e429f
|
@ -1775,14 +1775,6 @@ MarkContext(JSTracer *trc, JSContext *acx)
|
|||
MarkValue(trc, acx->iterValue, "iterValue");
|
||||
}
|
||||
|
||||
void
|
||||
MarkWeakReferences(GCMarker *trc)
|
||||
{
|
||||
trc->drainMarkStack();
|
||||
while (js_TraceWatchPoints(trc) || WeakMapBase::markAllIteratively(trc))
|
||||
trc->drainMarkStack();
|
||||
}
|
||||
|
||||
JS_REQUIRES_STACK void
|
||||
MarkRuntime(JSTracer *trc)
|
||||
{
|
||||
|
@ -1810,18 +1802,13 @@ MarkRuntime(JSTracer *trc)
|
|||
(*c)->traceMonitor()->mark(trc);
|
||||
#endif
|
||||
|
||||
for (ThreadDataIter i(rt); !i.empty(); i.popFront())
|
||||
i.threadData()->mark(trc);
|
||||
|
||||
if (IS_GC_MARKING_TRACER(trc)) {
|
||||
GCMarker *gcmarker = static_cast<GCMarker *>(trc);
|
||||
MarkWeakReferences(gcmarker);
|
||||
}
|
||||
|
||||
/*
|
||||
* We mark extra roots at the end so additional colors can be used
|
||||
* to implement cycle collection.
|
||||
*/
|
||||
for (ThreadDataIter i(rt); !i.empty(); i.popFront())
|
||||
i.threadData()->mark(trc);
|
||||
|
||||
/*
|
||||
* We mark extra roots at the last thing so it can use use additional
|
||||
* colors to implement cycle collection.
|
||||
*/
|
||||
if (rt->gcExtraRootsTraceOp)
|
||||
rt->gcExtraRootsTraceOp(trc, rt->gcExtraRootsData);
|
||||
}
|
||||
|
@ -2256,6 +2243,15 @@ MarkAndSweep(JSContext *cx, JSCompartment *comp, JSGCInvocationKind gckind GCTIM
|
|||
|
||||
gcmarker.drainMarkStack();
|
||||
|
||||
/*
|
||||
* Mark weak roots.
|
||||
*/
|
||||
while (true) {
|
||||
if (!js_TraceWatchPoints(&gcmarker) && !WeakMapBase::markAllIteratively(&gcmarker))
|
||||
break;
|
||||
gcmarker.drainMarkStack();
|
||||
}
|
||||
|
||||
rt->gcMarkingTracer = NULL;
|
||||
|
||||
if (rt->gcCallback)
|
||||
|
|
|
@ -1329,9 +1329,6 @@ struct GCMarker : public JSTracer {
|
|||
}
|
||||
};
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
MarkWeakReferences(GCMarker *trc);
|
||||
|
||||
void
|
||||
MarkStackRangeConservatively(JSTracer *trc, Value *begin, Value *end);
|
||||
|
||||
|
|
|
@ -373,10 +373,8 @@ void XPCJSRuntime::TraceJS(JSTracer* trc, void* data)
|
|||
gcmarker->setMarkColor(XPC_GC_COLOR_GRAY);
|
||||
}
|
||||
self->TraceXPConnectRoots(trc);
|
||||
if (gcmarker) {
|
||||
js::MarkWeakReferences(gcmarker);
|
||||
if (gcmarker)
|
||||
gcmarker->setMarkColor(XPC_GC_COLOR_BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Загрузка…
Ссылка в новой задаче