зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1376954 part 1. Ensure that we don't try to nursery-allocate non-wrappercached DOM objects. r=smaug
This commit is contained in:
Родитель
6cccc9defa
Коммит
239e1057ca
|
@ -453,6 +453,9 @@ class CGDOMJSClass(CGThing):
|
|||
traceHook = 'nullptr'
|
||||
reservedSlots = slotCount
|
||||
if self.descriptor.interface.hasProbablyShortLivingWrapper():
|
||||
if not self.descriptor.wrapperCache:
|
||||
raise TypeError("Need a wrapper cache to support nursery "
|
||||
"allocation of DOM objects")
|
||||
classFlags += " | JSCLASS_SKIP_NURSERY_FINALIZE"
|
||||
|
||||
if self.descriptor.interface.getExtendedAttribute("NeedResolve"):
|
||||
|
|
|
@ -260,6 +260,10 @@ public:
|
|||
bool AreGCGrayBitsValid() const;
|
||||
void GarbageCollect(uint32_t aReason) const;
|
||||
|
||||
// This needs to be an nsWrapperCache, not a JSObject, because we need to know
|
||||
// when our object gets moved. But we can't trace it (and hence update our
|
||||
// storage), because we do not want to keep it alive. nsWrapperCache handles
|
||||
// this for us via its "object moved" handling.
|
||||
void NurseryWrapperAdded(nsWrapperCache* aCache);
|
||||
void NurseryWrapperPreserved(JSObject* aWrapper);
|
||||
void JSObjectsTenured();
|
||||
|
|
Загрузка…
Ссылка в новой задаче