Bug 837566 - Remove js_RemoveRoot. r=terrence.

--HG--
extra : rebase_source : b3b615c34cfa4b9766a3484060242498c5a57e63
This commit is contained in:
Nicholas Nethercote 2013-02-03 20:16:19 -08:00
parent e093640250
commit cdfc960ca4
7 changed files with 19 additions and 21 deletions

View File

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

View File

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

View File

@ -1980,11 +1980,6 @@ 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

@ -1104,11 +1104,11 @@ js_AddObjectRoot(JSRuntime *rt, JSObject **objp)
extern JS_FRIEND_API(void)
js_RemoveObjectRoot(JSRuntime *rt, JSObject **objp)
{
js_RemoveRoot(rt, objp);
RemoveRoot(rt, objp);
}
JS_FRIEND_API(void)
js_RemoveRoot(JSRuntime *rt, void *rp)
void
js::RemoveRoot(JSRuntime *rt, void *rp)
{
rt->gcRootsHash.remove(rp);
rt->gcPoke = true;

View File

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

View File

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

View File

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