Bug 481514 - PurgeScopeChain should not deep-bail quite so eagerly (r=jorendorff, a=sayrer).

This commit is contained in:
Brendan Eich 2009-04-06 13:24:34 -07:00
parent 862f9eb6d3
commit fa172251b0

View File

@ -3594,6 +3594,15 @@ PurgeProtoChain(JSContext *cx, JSObject *obj, jsid id)
PCMETER(JS_PROPERTY_CACHE(cx).pcpurges++);
SCOPE_MAKE_UNIQUE_SHAPE(cx, scope);
JS_UNLOCK_SCOPE(cx, scope);
if (!STOBJ_GET_PARENT(scope->object)) {
/*
* All scope chains end in a global object, so this will change
* the global shape. jstracer.cpp assumes that the global shape
* never changes on trace, so we must deep-bail here.
*/
js_LeaveTrace(cx);
}
return JS_TRUE;
}
obj = LOCKED_OBJ_GET_PROTO(scope->object);
@ -3607,13 +3616,6 @@ js_PurgeScopeChainHelper(JSContext *cx, JSObject *obj, jsid id)
{
JS_ASSERT(OBJ_IS_DELEGATE(cx, obj));
/*
* All scope chains end in a global object, so this will change the global
* shape. jstracer.cpp assumes that the global shape never changes on
* trace, so we must deep-bail here.
*/
js_LeaveTrace(cx);
PurgeProtoChain(cx, OBJ_GET_PROTO(cx, obj), id);
while ((obj = OBJ_GET_PARENT(cx, obj)) != NULL) {
if (PurgeProtoChain(cx, obj, id))