Backed out changeset 61de331861af (bug 558058).

This commit is contained in:
Andreas Gal 2010-04-08 09:02:34 -07:00
Родитель 5c4f856ea3
Коммит c6710852fc
3 изменённых файлов: 9 добавлений и 21 удалений

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

@ -155,8 +155,6 @@ JSThreadData::mark(JSTracer *trc)
void void
JSThreadData::purge(JSContext *cx) JSThreadData::purge(JSContext *cx)
{ {
cachedIteratorObject = NULL;
purgeGCFreeLists(); purgeGCFreeLists();
js_PurgeGSNCache(&gsnCache); js_PurgeGSNCache(&gsnCache);

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

@ -567,12 +567,6 @@ struct JSThreadData {
jsuword nativeEnumCache[NATIVE_ENUM_CACHE_SIZE]; jsuword nativeEnumCache[NATIVE_ENUM_CACHE_SIZE];
/*
* One-entry deep cache of iterator objects. We deposit here the last
* iterator that was freed in JSOP_ENDITER.
*/
JSObject *cachedIteratorObject;
bool init(); bool init();
void finish(); void finish();
void mark(JSTracer *trc); void mark(JSTracer *trc);

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

@ -391,19 +391,16 @@ js_ValueToIterator(JSContext *cx, uintN flags, jsval *vp)
if (JSVAL_IS_VOID(*vp)) { if (JSVAL_IS_VOID(*vp)) {
default_iter: default_iter:
/* /*
* Fail over to the default enumerating native iterator. These objects * Fail over to the default enumerating native iterator.
* never escape, so we don't care for the proper parent or proto to *
* be set. Furthermore we re-use the last cached iterator object, if * Create iterobj with a NULL parent to ensure that we use the
* possible. * correct scope chain to lookup the iterator's constructor. Since
* we use the parent slot to keep track of the iterable, we must
* fix it up after.
*/ */
iterobj = JS_THREAD_DATA(cx)->cachedIteratorObject; iterobj = js_NewObject(cx, &js_IteratorClass, NULL, NULL);
if (iterobj) { if (!iterobj)
JS_THREAD_DATA(cx)->cachedIteratorObject = NULL; return false;
} else {
iterobj = js_NewObjectWithGivenProto(cx, &js_IteratorClass, NULL, NULL);
if (!iterobj)
return false;
}
/* Store in *vp to protect it from GC (callers must root vp). */ /* Store in *vp to protect it from GC (callers must root vp). */
*vp = OBJECT_TO_JSVAL(iterobj); *vp = OBJECT_TO_JSVAL(iterobj);
@ -437,7 +434,6 @@ js_CloseIterator(JSContext *cx, jsval v)
if (clasp == &js_IteratorClass) { if (clasp == &js_IteratorClass) {
js_CloseNativeIterator(cx, obj); js_CloseNativeIterator(cx, obj);
JS_THREAD_DATA(cx)->cachedIteratorObject = obj;
} }
#if JS_HAS_GENERATORS #if JS_HAS_GENERATORS
else if (clasp == &js_GeneratorClass) { else if (clasp == &js_GeneratorClass) {