Backout bug 506125 due to talos failures.

This commit is contained in:
Andreas Gal
2009-08-04 18:42:53 -07:00
parent fb6b8d7d1c
commit 918b8fb86d
14 changed files with 335 additions and 229 deletions

View File

@@ -4989,6 +4989,11 @@ js_Enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
JS_ASSERT(ne->cursor == (jsword) length);
if (allocated != 0) {
JS_LOCK_GC(cx->runtime);
if (!js_AddAsGCBytes(cx, allocated)) {
/* js_AddAsGCBytes releases the GC lock on failures. */
cx->free(ne);
return JS_FALSE;
}
ne->next = cx->runtime->nativeEnumerators;
cx->runtime->nativeEnumerators = ne;
JS_ASSERT(((jsuword) ne & (jsuword) 1) == (jsuword) 0);
@@ -5077,6 +5082,7 @@ js_TraceNativeEnumerators(JSTracer *trc)
js_TraceId(trc, *cursor);
} while (++cursor != end);
} else if (doGC) {
js_RemoveAsGCBytes(rt, NativeEnumeratorSize(ne->length));
*nep = ne->next;
trc->context->free(ne);
continue;