зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1449033 - Set new group unknown flag on placeholder prototypes where necessary r=jandem
This commit is contained in:
Родитель
83764e4a8a
Коммит
e057d51b4e
|
@ -8042,10 +8042,11 @@ GCRuntime::mergeCompartments(JSCompartment* source, JSCompartment* target)
|
|||
if (GlobalObject::isOffThreadPrototypePlaceholder(obj)) {
|
||||
JSObject* targetProto = global->getPrototypeForOffThreadPlaceholder(obj);
|
||||
MOZ_ASSERT(targetProto->isDelegate());
|
||||
MOZ_ASSERT_IF(targetProto->staticPrototypeIsImmutable(),
|
||||
obj->staticPrototypeIsImmutable());
|
||||
MOZ_ASSERT_IF(targetProto->isNewGroupUnknown(),
|
||||
obj->isNewGroupUnknown());
|
||||
group->setProtoUnchecked(TaggedProto(targetProto));
|
||||
AutoSweepObjectGroup sweep(group);
|
||||
if (targetProto->isNewGroupUnknown() && !group->unknownProperties(sweep))
|
||||
group->markUnknown(sweep, cx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -343,6 +343,12 @@ GlobalObject::resolveOffThreadConstructor(JSContext* cx,
|
|||
return false;
|
||||
}
|
||||
|
||||
if ((key == JSProto_Object || key == JSProto_Function || key == JSProto_Array) &&
|
||||
!JSObject::setNewGroupUnknown(cx, placeholder->getClass(), placeholder))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
global->setPrototype(key, ObjectValue(*placeholder));
|
||||
global->setConstructor(key, MagicValue(JS_OFF_THREAD_CONSTRUCTOR));
|
||||
return true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче