mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1196317 - Optimize CallbackObject::mCreationStack out from cycle collection graph when possible, r=mccr8
This commit is contained in:
parent
e3ae5d8cb9
commit
78190fcb2a
@ -1918,10 +1918,7 @@ nsGlobalWindow::UnmarkGrayTimers()
|
||||
if (timeout->mScriptHandler) {
|
||||
Function* f = timeout->mScriptHandler->GetCallback();
|
||||
if (f) {
|
||||
// Callable() already does xpc_UnmarkGrayObject.
|
||||
DebugOnly<JS::Handle<JSObject*> > o = f->Callable();
|
||||
MOZ_ASSERT(!JS::ObjectIsMarkedGray(o.value),
|
||||
"Should have been unmarked");
|
||||
f->MarkForCC();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,16 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
void MarkForCC()
|
||||
{
|
||||
if (mCallback) {
|
||||
JS::ExposeObjectToActiveJS(mCallback);
|
||||
}
|
||||
if (mCreationStack) {
|
||||
JS::ExposeObjectToActiveJS(mCreationStack);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This getter does not change the color of the JSObject meaning that the
|
||||
* object returned is not guaranteed to be kept alive past the next CC.
|
||||
|
@ -1469,13 +1469,12 @@ EventListenerManager::MarkForCC()
|
||||
const TypedEventHandler& typedHandler =
|
||||
jsEventHandler->GetTypedEventHandler();
|
||||
if (typedHandler.HasEventHandler()) {
|
||||
JS::ExposeObjectToActiveJS(typedHandler.Ptr()->Callable());
|
||||
typedHandler.Ptr()->MarkForCC();
|
||||
}
|
||||
} else if (listener.mListenerType == Listener::eWrappedJSListener) {
|
||||
xpc_TryUnmarkWrappedGrayObject(listener.mListener.GetXPCOMCallback());
|
||||
} else if (listener.mListenerType == Listener::eWebIDLListener) {
|
||||
// Callback() unmarks gray
|
||||
listener.mListener.GetWebIDLCallback()->Callback();
|
||||
listener.mListener.GetWebIDLCallback()->MarkForCC();
|
||||
}
|
||||
}
|
||||
if (mRefCnt.IsPurple()) {
|
||||
|
Loading…
Reference in New Issue
Block a user