Bug 553671 part 10 - Get rid of "goto restart_at_beginning;". r=luke.

--HG--
extra : rebase_source : 9d0128640af7d366133d59fed9c21160078ba5ca
This commit is contained in:
Jason Orendorff 2010-04-22 07:34:28 -05:00
parent ac7bf3b598
commit e3724fb9c0

View File

@ -3520,28 +3520,33 @@ js_GC(JSContext *cx, JSGCInvocationKind gckind)
#endif
TIMESTAMP(gcTimer.enter);
restart_at_beginning:
if (!FireGCBegin(cx, gckind))
return;
for (;;) {
if (!FireGCBegin(cx, gckind))
return;
/* Lock out other GC allocator and collector invocations. */
if (!(gckind & GC_LOCK_HELD))
JS_LOCK_GC(rt);
{
/* Lock out other GC allocator and collector invocations. */
Conditionally<AutoLockGC> lockIf(!(gckind & GC_LOCK_HELD), rt);
if (!BeginGCSession(cx, gckind)) {
/* We're already doing GC or another thread did GC for us. */
if (!(gckind & GC_LOCK_HELD))
JS_UNLOCK_GC(rt);
return;
}
if (!BeginGCSession(cx, gckind)) {
/* We're already doing GC or another thread did GC for us. */
return;
}
if (gckind == GC_SET_SLOT_REQUEST && !ProcessAllSetSlotRequests(cx, &gckind))
return;
if (gckind == GC_SET_SLOT_REQUEST && !ProcessAllSetSlotRequests(cx, &gckind))
return;
if (gckind != GC_SET_SLOT_REQUEST) {
if (!JS_ON_TRACE(cx))
GCUntilDone(cx, gckind GCTIMER_ARG);
rt->setGCLastBytes(rt->gcBytes);
if (gckind != GC_SET_SLOT_REQUEST) {
if (!JS_ON_TRACE(cx))
GCUntilDone(cx, gckind GCTIMER_ARG);
rt->setGCLastBytes(rt->gcBytes);
}
EndGCSession(cx);
}
if (FireGCEnd(cx, gckind))
break;
}
EndGCSession(cx);