Backed out changeset 2861ef67390a (bug 837566) for Linux32 mochitest-other shutdown hangs.

This commit is contained in:
Ryan VanderMeulen 2013-02-05 07:54:49 -05:00
parent 549336585a
commit 67b204034f
7 changed files with 20 additions and 18 deletions

View File

@ -571,7 +571,7 @@ nsJSObjWrapper::NP_Invalidate(NPObject *npobj)
if (jsnpobj && jsnpobj->mJSObj) {
// Unroot the object's JSObject
JS_RemoveObjectRootRT(sJSRuntime, &jsnpobj->mJSObj);
js_RemoveRoot(sJSRuntime, &jsnpobj->mJSObj);
if (sJSObjWrappers.ops) {
// Remove the wrapper from the hash

View File

@ -2349,52 +2349,52 @@ JS_PUBLIC_API(void)
JS_RemoveValueRoot(JSContext *cx, jsval *vp)
{
CHECK_REQUEST(cx);
RemoveRoot(cx->runtime, (void *)vp);
js_RemoveRoot(cx->runtime, (void *)vp);
}
JS_PUBLIC_API(void)
JS_RemoveStringRoot(JSContext *cx, JSString **rp)
{
CHECK_REQUEST(cx);
RemoveRoot(cx->runtime, (void *)rp);
js_RemoveRoot(cx->runtime, (void *)rp);
}
JS_PUBLIC_API(void)
JS_RemoveObjectRoot(JSContext *cx, JSObject **rp)
{
CHECK_REQUEST(cx);
RemoveRoot(cx->runtime, (void *)rp);
js_RemoveRoot(cx->runtime, (void *)rp);
}
JS_PUBLIC_API(void)
JS_RemoveScriptRoot(JSContext *cx, JSScript **rp)
{
CHECK_REQUEST(cx);
RemoveRoot(cx->runtime, (void *)rp);
js_RemoveRoot(cx->runtime, (void *)rp);
}
JS_PUBLIC_API(void)
JS_RemoveValueRootRT(JSRuntime *rt, jsval *vp)
{
RemoveRoot(rt, (void *)vp);
js_RemoveRoot(rt, (void *)vp);
}
JS_PUBLIC_API(void)
JS_RemoveStringRootRT(JSRuntime *rt, JSString **rp)
{
RemoveRoot(rt, (void *)rp);
js_RemoveRoot(rt, (void *)rp);
}
JS_PUBLIC_API(void)
JS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp)
{
RemoveRoot(rt, (void *)rp);
js_RemoveRoot(rt, (void *)rp);
}
JS_PUBLIC_API(void)
JS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp)
{
RemoveRoot(rt, (void *)rp);
js_RemoveRoot(rt, (void *)rp);
}
JS_NEVER_INLINE JS_PUBLIC_API(void)

View File

@ -3624,6 +3624,11 @@ JS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp);
extern JS_PUBLIC_API(void)
JS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp);
/* TODO: remove these APIs */
extern JS_FRIEND_API(void)
js_RemoveRoot(JSRuntime *rt, void *rp);
/*
* C-compatible version of the Anchor class. It should be called after the last
* use of the variable it protects.

View File

@ -770,10 +770,10 @@ JS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda)
pd = pda->array;
for (i = 0; i < pda->length; i++) {
RemoveRoot(cx->runtime, &pd[i].id);
RemoveRoot(cx->runtime, &pd[i].value);
js_RemoveRoot(cx->runtime, &pd[i].id);
js_RemoveRoot(cx->runtime, &pd[i].value);
if (pd[i].flags & JSPD_ALIAS)
RemoveRoot(cx->runtime, &pd[i].alias);
js_RemoveRoot(cx->runtime, &pd[i].alias);
}
js_free(pd);
pda->array = NULL;

View File

@ -1084,8 +1084,8 @@ js::AddScriptRoot(JSContext *cx, JSScript **rp, const char *name)
return AddRoot(cx, rp, name, JS_GC_ROOT_SCRIPT_PTR);
}
void
js::RemoveRoot(JSRuntime *rt, void *rp)
JS_FRIEND_API(void)
js_RemoveRoot(JSRuntime *rt, void *rp)
{
rt->gcRootsHash.remove(rp);
rt->gcPoke = true;

View File

@ -514,9 +514,6 @@ AddObjectRoot(JSContext *cx, JSObject **rp, const char *name);
extern JSBool
AddScriptRoot(JSContext *cx, JSScript **rp, const char *name);
void
RemoveRoot(JSRuntime *rt, void *rp);
} /* namespace js */
extern JSBool

View File

@ -65,7 +65,7 @@ public:
bool Hold(JSRuntime* aRt) {
// Do we really care about different runtimes?
if (mRt && aRt != mRt) {
JS_RemoveValueRootRT(mRt, &mVal);
js_RemoveRoot(mRt, &mVal);
mRt = nullptr;
}