mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 659462 - remove no-op JS_ClearNewbornRoots and uses in xpconnect (r=mrbkap)
This commit is contained in:
parent
a860fb2d95
commit
e25124700b
@ -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)
|
||||
|
@ -1665,7 +1665,6 @@ JSCLContextHelper::Pop()
|
||||
{
|
||||
JSContext* cx = nsnull;
|
||||
if (mContextStack) {
|
||||
JS_ClearNewbornRoots(mContext);
|
||||
if (mContextThread) {
|
||||
JS_EndRequest(mContext);
|
||||
}
|
||||
|
@ -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 ...
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user