mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 940071: Free the proto and iface cache for generated globals. r=bz
This commit is contained in:
parent
46505eecd5
commit
7b4374f293
@ -2167,6 +2167,13 @@ TraceGlobal(JSTracer* aTrc, JSObject* aObj)
|
||||
mozilla::dom::TraceProtoAndIfaceCache(aTrc, aObj);
|
||||
}
|
||||
|
||||
void
|
||||
FinalizeGlobal(JSFreeOp* aFreeOp, JSObject* aObj)
|
||||
{
|
||||
MOZ_ASSERT(js::GetObjectClass(aObj)->flags & JSCLASS_DOM_GLOBAL);
|
||||
mozilla::dom::DestroyProtoAndIfaceCache(aObj);
|
||||
}
|
||||
|
||||
bool
|
||||
ResolveGlobal(JSContext* aCx, JS::Handle<JSObject*> aObj,
|
||||
JS::MutableHandle<jsid> aId, unsigned aFlags,
|
||||
|
@ -290,6 +290,11 @@ AllocateProtoAndIfaceCache(JSObject* obj)
|
||||
|
||||
js::SetReservedSlot(obj, DOM_PROTOTYPE_SLOT,
|
||||
JS::PrivateValue(protoAndIfaceArray));
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
NS_LogCtor((void*)protoAndIfaceArray, "ProtoAndIfaceArray",
|
||||
sizeof(JS::Heap<JSObject*>) * kProtoAndIfaceCacheCount);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void
|
||||
@ -314,6 +319,11 @@ DestroyProtoAndIfaceCache(JSObject* obj)
|
||||
|
||||
JS::Heap<JSObject*>* protoAndIfaceArray = GetProtoAndIfaceArray(obj);
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
NS_LogDtor((void*)protoAndIfaceArray, "ProtoAndIfaceArray",
|
||||
sizeof(JS::Heap<JSObject*>) * kProtoAndIfaceCacheCount);
|
||||
#endif
|
||||
|
||||
delete [] protoAndIfaceArray;
|
||||
}
|
||||
|
||||
@ -2274,6 +2284,9 @@ ThreadsafeCheckIsChrome(JSContext* aCx, JSObject* aObj);
|
||||
void
|
||||
TraceGlobal(JSTracer* aTrc, JSObject* aObj);
|
||||
|
||||
void
|
||||
FinalizeGlobal(JSFreeOp* aFop, JSObject* aObj);
|
||||
|
||||
bool
|
||||
ResolveGlobal(JSContext* aCx, JS::Handle<JSObject*> aObj,
|
||||
JS::MutableHandle<jsid> aId, unsigned aFlags,
|
||||
|
@ -1084,6 +1084,8 @@ def finalizeHook(descriptor, hookName, context):
|
||||
finalize += "ClearWrapper(self, self);\n"
|
||||
if descriptor.interface.getExtendedAttribute('OverrideBuiltins'):
|
||||
finalize += "self->mExpandoAndGeneration.expando = JS::UndefinedValue();\n"
|
||||
if descriptor.interface.getExtendedAttribute("Global"):
|
||||
finalize += "mozilla::dom::FinalizeGlobal(fop, obj);\n"
|
||||
if descriptor.nativeOwnership == 'worker':
|
||||
finalize += "self->Release();"
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user