Bug 659462 - remove no-op JS_ClearNewbornRoots and uses in xpconnect (r=mrbkap)

This commit is contained in:
Luke Wagner 2011-05-13 08:56:25 -07:00
parent a860fb2d95
commit e25124700b
6 changed files with 0 additions and 30 deletions

View File

@ -1505,7 +1505,6 @@ JS_AnchorPtr(void *p);
#define JS_TYPED_ROOTING_API
/* Obsolete rooting APIs. */
#define JS_ClearNewbornRoots(cx) ((void) 0)
#define JS_EnterLocalRootScope(cx) (JS_TRUE)
#define JS_LeaveLocalRootScope(cx) ((void) 0)
#define JS_LeaveLocalRootScopeWithResult(cx, rval) ((void) 0)

View File

@ -1665,7 +1665,6 @@ JSCLContextHelper::Pop()
{
JSContext* cx = nsnull;
if (mContextStack) {
JS_ClearNewbornRoots(mContext);
if (mContextThread) {
JS_EndRequest(mContext);
}

View File

@ -389,8 +389,6 @@ nsXPConnect::Collect()
if(!ccx.IsValid())
return;
nsXPConnect::GetRuntimeInstance()->ClearWeakRoots();
JSContext *cx = ccx.GetJSContext();
// We want to scan the current thread for GC roots only if it was in a
@ -2159,7 +2157,6 @@ nsXPConnect::ReleaseJSContext(JSContext * aJSContext, PRBool noGC)
(void *)aJSContext);
#endif
ccx->SetDestroyJSContextInDestructor(JS_TRUE);
JS_ClearNewbornRoots(aJSContext);
return NS_OK;
}
// else continue on and synchronously destroy the JSContext ...

View File

@ -401,14 +401,6 @@ XPCCallContext::~XPCCallContext()
JS_DestroyContext(mJSContext);
}
else
{
// Don't clear newborns if JS frames (compilation or execution)
// are active! Doing so violates ancient invariants in the JS
// engine, and it's not necessary to fix JS component leaks.
if(!JS_IsRunning(mJSContext))
JS_ClearNewbornRoots(mJSContext);
}
}
#ifdef DEBUG

View File

@ -593,21 +593,6 @@ XPCJSRuntime::AddXPConnectRoots(JSContext* cx,
GetCompartmentMap().EnumerateRead(SuspectCompartment, &closure);
}
void
XPCJSRuntime::ClearWeakRoots()
{
JSContext *iter = nsnull, *acx;
while((acx = JS_ContextIterator(GetJSRuntime(), &iter)))
{
if(XPCPerThreadData::IsMainThread(acx) &&
!nsXPConnect::GetXPConnect()->GetOutstandingRequests(acx))
{
JS_ClearNewbornRoots(acx);
}
}
}
template<class T> static void
DoDeferredRelease(nsTArray<T> &array)
{

View File

@ -761,8 +761,6 @@ public:
nsresult AddJSHolder(void* aHolder, nsScriptObjectTracer* aTracer);
nsresult RemoveJSHolder(void* aHolder);
void ClearWeakRoots();
static void SuspectWrappedNative(JSContext *cx, XPCWrappedNative *wrapper,
nsCycleCollectionTraversalCallback &cb);