From 3a3bac66829fbc741ca19f2b099107eb5689d492 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Sun, 4 Dec 2011 18:48:54 -0800 Subject: [PATCH] Back out e0cb9fb30750 (bug 707051) for test failures --- js/src/jsapi.cpp | 2 +- js/src/jsgcmark.cpp | 7 ++++--- js/src/jsscope.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 31549370d5c3..4950f45f147e 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -4183,7 +4183,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp) JS_ASSERT(shape->isEmptyShape()); *idp = JSID_VOID; } else { - iterobj->setPrivate(const_cast(shape->previous().get())); + iterobj->setPrivate(const_cast(shape->previous())); *idp = shape->propid(); } } else { diff --git a/js/src/jsgcmark.cpp b/js/src/jsgcmark.cpp index 29554b6c013a..f3bc8b9ed71a 100644 --- a/js/src/jsgcmark.cpp +++ b/js/src/jsgcmark.cpp @@ -735,7 +735,6 @@ restart: else if (JS_UNLIKELY(JSID_IS_OBJECT(id))) PushMarkStack(gcmarker, JSID_TO_OBJECT(id)); - /* We need the loop here to prevent unbounded recursion. */ shape = shape->previous(); if (shape && shape->markIfUnmarked(gcmarker->getMarkColor())) goto restart; @@ -975,11 +974,13 @@ MarkChildren(JSTracer *trc, JSScript *script) void MarkChildren(JSTracer *trc, const Shape *shape) { +restart: MarkBaseShapeUnbarriered(trc, shape->base(), "base"); MarkIdUnbarriered(trc, shape->maybePropid(), "propid"); - if (shape->previous()) - MarkShape(trc, shape->previous(), "parent"); + shape = shape->previous(); + if (shape) + goto restart; } void diff --git a/js/src/jsscope.h b/js/src/jsscope.h index bd2e272def0b..e0f15fc0b0c9 100644 --- a/js/src/jsscope.h +++ b/js/src/jsscope.h @@ -592,7 +592,7 @@ struct Shape : public js::gc::Cell return !(flags & NON_NATIVE); } - const HeapPtrShape &previous() const { + const js::Shape *previous() const { return parent; }