Bug 844112 - GC: Fix misc build and test failures in exactly rooted shell r=sfink

This commit is contained in:
Jon Coppeard 2013-02-22 15:14:09 +00:00
parent 30c6f9bebb
commit c919b27a50
3 changed files with 9 additions and 4 deletions

View File

@ -49,6 +49,9 @@ MarkExactStackRoot(JSTracer *trc, Rooted<void*> *rooter, ThingRootKind kind)
if (!*addr) if (!*addr)
return; return;
if (kind == THING_ROOT_OBJECT && *addr == Proxy::LazyProto)
return;
switch (kind) { switch (kind) {
case THING_ROOT_OBJECT: MarkObjectRoot(trc, (JSObject **)addr, "exact-object"); break; case THING_ROOT_OBJECT: MarkObjectRoot(trc, (JSObject **)addr, "exact-object"); break;
case THING_ROOT_STRING: MarkStringRoot(trc, (JSString **)addr, "exact-string"); break; case THING_ROOT_STRING: MarkStringRoot(trc, (JSString **)addr, "exact-string"); break;
@ -81,7 +84,7 @@ MarkExactStackRoots(JSTracer *trc)
for (ContextIter cx(trc->runtime); !cx.done(); cx.next()) for (ContextIter cx(trc->runtime); !cx.done(); cx.next())
MarkExactStackRootList(trc, cx->thingGCRooters[i], ThingRootKind(i)); MarkExactStackRootList(trc, cx->thingGCRooters[i], ThingRootKind(i));
MarkExactStackRootList(trc, trc->runtime->mainThread->thingGCRooters[i], ThingRootKind(i)); MarkExactStackRootList(trc, trc->runtime->mainThread.thingGCRooters[i], ThingRootKind(i));
} }
} }
#endif /* JSGC_USE_EXACT_ROOTING */ #endif /* JSGC_USE_EXACT_ROOTING */

View File

@ -1208,11 +1208,11 @@ JSContext::JSContext(JSRuntime *rt)
JS_ASSERT(static_cast<ContextFriendFields*>(this) == JS_ASSERT(static_cast<ContextFriendFields*>(this) ==
ContextFriendFields::get(this)); ContextFriendFields::get(this));
#ifdef JSGC_ROOT_ANALYSIS #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING)
PodArrayZero(thingGCRooters); PodArrayZero(thingGCRooters);
#if defined(JS_GC_ZEAL) && defined(DEBUG) && !defined(JS_THREADSAFE)
skipGCRooters = NULL;
#endif #endif
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
skipGCRooters = NULL;
#endif #endif
} }

View File

@ -1646,6 +1646,7 @@ BEGIN_CASE(JSOP_IN)
if (!JSObject::lookupGeneric(cx, obj, id, &obj2, &prop)) if (!JSObject::lookupGeneric(cx, obj, id, &obj2, &prop))
goto error; goto error;
bool cond = prop != NULL; bool cond = prop != NULL;
prop = NULL;
TRY_BRANCH_AFTER_COND(cond, 2); TRY_BRANCH_AFTER_COND(cond, 2);
regs.sp--; regs.sp--;
regs.sp[-1].setBoolean(cond); regs.sp[-1].setBoolean(cond);
@ -2087,6 +2088,7 @@ BEGIN_CASE(JSOP_DELNAME)
if (!JSObject::deleteProperty(cx, scope, name, res, false)) if (!JSObject::deleteProperty(cx, scope, name, res, false))
goto error; goto error;
} }
prop = NULL;
} }
END_CASE(JSOP_DELNAME) END_CASE(JSOP_DELNAME)