mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
1320408 - Part 4: Change JSObject::getGroup to static method.
This commit is contained in:
parent
ed78b21cf0
commit
87bfc02f09
14 changed files with 56 additions and 45 deletions
|
|
@ -2253,16 +2253,22 @@ DenseOrUnboxedArraySetElemStubExists(JSContext* cx, ICStub::Kind kind,
|
||||||
for (ICStubConstIterator iter = stub->beginChainConst(); !iter.atEnd(); iter++) {
|
for (ICStubConstIterator iter = stub->beginChainConst(); !iter.atEnd(); iter++) {
|
||||||
if (kind == ICStub::SetElem_DenseOrUnboxedArray && iter->isSetElem_DenseOrUnboxedArray()) {
|
if (kind == ICStub::SetElem_DenseOrUnboxedArray && iter->isSetElem_DenseOrUnboxedArray()) {
|
||||||
ICSetElem_DenseOrUnboxedArray* nstub = iter->toSetElem_DenseOrUnboxedArray();
|
ICSetElem_DenseOrUnboxedArray* nstub = iter->toSetElem_DenseOrUnboxedArray();
|
||||||
if (obj->maybeShape() == nstub->shape() && obj->getGroup(cx) == nstub->group())
|
if (obj->maybeShape() == nstub->shape() &&
|
||||||
|
JSObject::getGroup(cx, obj) == nstub->group())
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (kind == ICStub::SetElem_DenseOrUnboxedArrayAdd && iter->isSetElem_DenseOrUnboxedArrayAdd()) {
|
if (kind == ICStub::SetElem_DenseOrUnboxedArrayAdd && iter->isSetElem_DenseOrUnboxedArrayAdd()) {
|
||||||
ICSetElem_DenseOrUnboxedArrayAdd* nstub = iter->toSetElem_DenseOrUnboxedArrayAdd();
|
ICSetElem_DenseOrUnboxedArrayAdd* nstub = iter->toSetElem_DenseOrUnboxedArrayAdd();
|
||||||
if (obj->getGroup(cx) == nstub->group() && SetElemAddHasSameShapes(nstub, obj))
|
if (JSObject::getGroup(cx, obj) == nstub->group() &&
|
||||||
|
SetElemAddHasSameShapes(nstub, obj))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2446,7 +2452,7 @@ DoSetElemFallback(JSContext* cx, BaselineFrame* frame, ICSetElem_Fallback* stub_
|
||||||
&addingCase, &protoDepth))
|
&addingCase, &protoDepth))
|
||||||
{
|
{
|
||||||
RootedShape shape(cx, obj->maybeShape());
|
RootedShape shape(cx, obj->maybeShape());
|
||||||
RootedObjectGroup group(cx, obj->getGroup(cx));
|
RootedObjectGroup group(cx, JSObject::getGroup(cx, obj));
|
||||||
if (!group)
|
if (!group)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -4277,7 +4283,7 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return false;
|
return false;
|
||||||
RootedShape oldShape(cx, obj->maybeShape());
|
RootedShape oldShape(cx, obj->maybeShape());
|
||||||
RootedObjectGroup oldGroup(cx, obj->getGroup(cx));
|
RootedObjectGroup oldGroup(cx, JSObject::getGroup(cx, obj));
|
||||||
if (!oldGroup)
|
if (!oldGroup)
|
||||||
return false;
|
return false;
|
||||||
RootedReceiverGuard oldGuard(cx, ReceiverGuard(obj));
|
RootedReceiverGuard oldGuard(cx, ReceiverGuard(obj));
|
||||||
|
|
@ -5175,14 +5181,13 @@ GetTemplateObjectForNative(JSContext* cx, HandleFunction target, const CallArgs&
|
||||||
|
|
||||||
if (native == js::array_slice) {
|
if (native == js::array_slice) {
|
||||||
if (args.thisv().isObject()) {
|
if (args.thisv().isObject()) {
|
||||||
JSObject* obj = &args.thisv().toObject();
|
RootedObject obj(cx, &args.thisv().toObject());
|
||||||
if (!obj->isSingleton()) {
|
if (!obj->isSingleton()) {
|
||||||
if (obj->group()->maybePreliminaryObjects()) {
|
if (obj->group()->maybePreliminaryObjects()) {
|
||||||
*skipAttach = true;
|
*skipAttach = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
res.set(NewFullyAllocatedArrayTryReuseGroup(cx, &args.thisv().toObject(), 0,
|
res.set(NewFullyAllocatedArrayTryReuseGroup(cx, obj, 0, TenuredObject));
|
||||||
TenuredObject));
|
|
||||||
return !!res;
|
return !!res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7961,7 +7966,7 @@ ICUpdatedStub*
|
||||||
ICSetElemDenseOrUnboxedArrayAddCompiler::getStubSpecific(ICStubSpace* space,
|
ICSetElemDenseOrUnboxedArrayAddCompiler::getStubSpecific(ICStubSpace* space,
|
||||||
Handle<ShapeVector> shapes)
|
Handle<ShapeVector> shapes)
|
||||||
{
|
{
|
||||||
RootedObjectGroup group(cx, obj_->getGroup(cx));
|
RootedObjectGroup group(cx, JSObject::getGroup(cx, obj_));
|
||||||
if (!group)
|
if (!group)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
Rooted<JitCode*> stubCode(cx, getStubCode());
|
Rooted<JitCode*> stubCode(cx, getStubCode());
|
||||||
|
|
@ -8098,7 +8103,7 @@ ICSetProp_Native::ICSetProp_Native(JitCode* stubCode, ObjectGroup* group, Shape*
|
||||||
ICSetProp_Native*
|
ICSetProp_Native*
|
||||||
ICSetProp_Native::Compiler::getStub(ICStubSpace* space)
|
ICSetProp_Native::Compiler::getStub(ICStubSpace* space)
|
||||||
{
|
{
|
||||||
RootedObjectGroup group(cx, obj_->getGroup(cx));
|
RootedObjectGroup group(cx, JSObject::getGroup(cx, obj_));
|
||||||
if (!group)
|
if (!group)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1940,7 +1940,7 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler
|
||||||
template <size_t ProtoChainDepth>
|
template <size_t ProtoChainDepth>
|
||||||
ICUpdatedStub* getStubSpecific(ICStubSpace* space, Handle<ShapeVector> shapes)
|
ICUpdatedStub* getStubSpecific(ICStubSpace* space, Handle<ShapeVector> shapes)
|
||||||
{
|
{
|
||||||
RootedObjectGroup newGroup(cx, obj_->getGroup(cx));
|
RootedObjectGroup newGroup(cx, JSObject::getGroup(cx, obj_));
|
||||||
if (!newGroup)
|
if (!newGroup)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3316,7 +3316,7 @@ SetPropertyIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex
|
||||||
RootedObjectGroup oldGroup(cx);
|
RootedObjectGroup oldGroup(cx);
|
||||||
RootedShape oldShape(cx);
|
RootedShape oldShape(cx);
|
||||||
if (cache.canAttachStub()) {
|
if (cache.canAttachStub()) {
|
||||||
oldGroup = obj->getGroup(cx);
|
oldGroup = JSObject::getGroup(cx, obj);
|
||||||
if (!oldGroup)
|
if (!oldGroup)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -602,7 +602,7 @@ js::ArraySetLength(JSContext* cx, Handle<ArrayObject*> arr, HandleId id,
|
||||||
// for..in iteration over the array. Keys deleted before being reached
|
// for..in iteration over the array. Keys deleted before being reached
|
||||||
// during the iteration must not be visited, and suppressing them here
|
// during the iteration must not be visited, and suppressing them here
|
||||||
// would be too costly.
|
// would be too costly.
|
||||||
ObjectGroup* arrGroup = arr->getGroup(cx);
|
ObjectGroup* arrGroup = JSObject::getGroup(cx, arr);
|
||||||
if (MOZ_UNLIKELY(!arrGroup))
|
if (MOZ_UNLIKELY(!arrGroup))
|
||||||
return false;
|
return false;
|
||||||
if (!arr->isIndexed() && !MOZ_UNLIKELY(arrGroup->hasAllFlags(OBJECT_FLAG_ITERATED))) {
|
if (!arr->isIndexed() && !MOZ_UNLIKELY(arrGroup->hasAllFlags(OBJECT_FLAG_ITERATED))) {
|
||||||
|
|
@ -1285,7 +1285,7 @@ InitArrayElements(JSContext* cx, HandleObject obj, uint32_t start,
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
ObjectGroup* group = obj->getGroup(cx);
|
ObjectGroup* group = JSObject::getGroup(cx, obj);
|
||||||
if (!group)
|
if (!group)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -2144,7 +2144,7 @@ ArrayShiftDenseKernel(JSContext* cx, HandleObject obj, MutableHandleValue rval)
|
||||||
if (ObjectMayHaveExtraIndexedProperties(obj))
|
if (ObjectMayHaveExtraIndexedProperties(obj))
|
||||||
return DenseElementResult::Incomplete;
|
return DenseElementResult::Incomplete;
|
||||||
|
|
||||||
RootedObjectGroup group(cx, obj->getGroup(cx));
|
RootedObjectGroup group(cx, JSObject::getGroup(cx, obj));
|
||||||
if (MOZ_UNLIKELY(!group))
|
if (MOZ_UNLIKELY(!group))
|
||||||
return DenseElementResult::Failure;
|
return DenseElementResult::Failure;
|
||||||
|
|
||||||
|
|
@ -2340,7 +2340,7 @@ CanOptimizeForDenseStorage(HandleObject arr, uint32_t startingIndex, uint32_t co
|
||||||
* deleted if a hole is moved from one location to another location not yet
|
* deleted if a hole is moved from one location to another location not yet
|
||||||
* visited. See bug 690622.
|
* visited. See bug 690622.
|
||||||
*/
|
*/
|
||||||
ObjectGroup* arrGroup = arr->getGroup(cx);
|
ObjectGroup* arrGroup = JSObject::getGroup(cx, arr);
|
||||||
if (!arrGroup) {
|
if (!arrGroup) {
|
||||||
cx->recoverFromOutOfMemory();
|
cx->recoverFromOutOfMemory();
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -3586,7 +3586,7 @@ js::NewPartlyAllocatedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup g
|
||||||
// will have unknown property types.
|
// will have unknown property types.
|
||||||
template <uint32_t maxLength>
|
template <uint32_t maxLength>
|
||||||
static inline ArrayObject*
|
static inline ArrayObject*
|
||||||
NewArrayTryReuseGroup(JSContext* cx, JSObject* obj, size_t length,
|
NewArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length,
|
||||||
NewObjectKind newKind = GenericObject)
|
NewObjectKind newKind = GenericObject)
|
||||||
{
|
{
|
||||||
if (!obj->is<ArrayObject>())
|
if (!obj->is<ArrayObject>())
|
||||||
|
|
@ -3595,7 +3595,7 @@ NewArrayTryReuseGroup(JSContext* cx, JSObject* obj, size_t length,
|
||||||
if (obj->staticPrototype() != cx->global()->maybeGetArrayPrototype())
|
if (obj->staticPrototype() != cx->global()->maybeGetArrayPrototype())
|
||||||
return NewArray<maxLength>(cx, length, nullptr, newKind);
|
return NewArray<maxLength>(cx, length, nullptr, newKind);
|
||||||
|
|
||||||
RootedObjectGroup group(cx, obj->getGroup(cx));
|
RootedObjectGroup group(cx, JSObject::getGroup(cx, obj));
|
||||||
if (!group)
|
if (!group)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|
@ -3603,14 +3603,14 @@ NewArrayTryReuseGroup(JSContext* cx, JSObject* obj, size_t length,
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayObject*
|
ArrayObject*
|
||||||
js::NewFullyAllocatedArrayTryReuseGroup(JSContext* cx, JSObject* obj, size_t length,
|
js::NewFullyAllocatedArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length,
|
||||||
NewObjectKind newKind)
|
NewObjectKind newKind)
|
||||||
{
|
{
|
||||||
return NewArrayTryReuseGroup<UINT32_MAX>(cx, obj, length, newKind);
|
return NewArrayTryReuseGroup<UINT32_MAX>(cx, obj, length, newKind);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayObject*
|
ArrayObject*
|
||||||
js::NewPartlyAllocatedArrayTryReuseGroup(JSContext* cx, JSObject* obj, size_t length)
|
js::NewPartlyAllocatedArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length)
|
||||||
{
|
{
|
||||||
return NewArrayTryReuseGroup<ArrayObject::EagerAllocationMaxLength>(cx, obj, length);
|
return NewArrayTryReuseGroup<ArrayObject::EagerAllocationMaxLength>(cx, obj, length);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,11 +83,11 @@ extern ArrayObject*
|
||||||
NewPartlyAllocatedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, size_t length);
|
NewPartlyAllocatedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, size_t length);
|
||||||
|
|
||||||
extern ArrayObject*
|
extern ArrayObject*
|
||||||
NewFullyAllocatedArrayTryReuseGroup(JSContext* cx, JSObject* obj, size_t length,
|
NewFullyAllocatedArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length,
|
||||||
NewObjectKind newKind = GenericObject);
|
NewObjectKind newKind = GenericObject);
|
||||||
|
|
||||||
extern ArrayObject*
|
extern ArrayObject*
|
||||||
NewPartlyAllocatedArrayTryReuseGroup(JSContext* cx, JSObject* obj, size_t length);
|
NewPartlyAllocatedArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length);
|
||||||
|
|
||||||
extern ArrayObject*
|
extern ArrayObject*
|
||||||
NewFullyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length,
|
NewFullyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length,
|
||||||
|
|
|
||||||
|
|
@ -826,7 +826,7 @@ CreateFunctionPrototype(JSContext* cx, JSProtoKey key)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
functionProto->initScript(script);
|
functionProto->initScript(script);
|
||||||
ObjectGroup* protoGroup = functionProto->getGroup(cx);
|
ObjectGroup* protoGroup = JSObject::getGroup(cx, functionProto);
|
||||||
if (!protoGroup)
|
if (!protoGroup)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1489,9 +1489,9 @@ JSObject::swap(JSContext* cx, HandleObject a, HandleObject b)
|
||||||
|
|
||||||
AutoCompartment ac(cx, a);
|
AutoCompartment ac(cx, a);
|
||||||
|
|
||||||
if (!a->getGroup(cx))
|
if (!JSObject::getGroup(cx, a))
|
||||||
oomUnsafe.crash("JSObject::swap");
|
oomUnsafe.crash("JSObject::swap");
|
||||||
if (!b->getGroup(cx))
|
if (!JSObject::getGroup(cx, b))
|
||||||
oomUnsafe.crash("JSObject::swap");
|
oomUnsafe.crash("JSObject::swap");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -3852,7 +3852,8 @@ displayAtomFromObjectGroup(ObjectGroup& group)
|
||||||
bool
|
bool
|
||||||
JSObject::constructorDisplayAtom(JSContext* cx, js::MutableHandleAtom name)
|
JSObject::constructorDisplayAtom(JSContext* cx, js::MutableHandleAtom name)
|
||||||
{
|
{
|
||||||
ObjectGroup *g = getGroup(cx);
|
RootedObject self(cx, this); // Temporary change.
|
||||||
|
ObjectGroup *g = JSObject::getGroup(cx, self);
|
||||||
if (!g)
|
if (!g)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ class JSObject : public js::gc::Cell
|
||||||
// Change an existing object to have a singleton group.
|
// Change an existing object to have a singleton group.
|
||||||
static bool changeToSingleton(JSContext* cx, js::HandleObject obj);
|
static bool changeToSingleton(JSContext* cx, js::HandleObject obj);
|
||||||
|
|
||||||
inline js::ObjectGroup* getGroup(JSContext* cx);
|
static inline js::ObjectGroup* getGroup(JSContext* cx, js::HandleObject obj);
|
||||||
|
|
||||||
const js::GCPtrObjectGroup& groupFromGC() const {
|
const js::GCPtrObjectGroup& groupFromGC() const {
|
||||||
/* Direct field access for use by GC. */
|
/* Direct field access for use by GC. */
|
||||||
|
|
|
||||||
|
|
@ -117,17 +117,16 @@ JSObject::setSingleton(js::ExclusiveContext* cx, js::HandleObject obj)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline js::ObjectGroup*
|
/* static */ inline js::ObjectGroup*
|
||||||
JSObject::getGroup(JSContext* cx)
|
JSObject::getGroup(JSContext* cx, js::HandleObject obj)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(cx->compartment() == compartment());
|
MOZ_ASSERT(cx->compartment() == obj->compartment());
|
||||||
if (hasLazyGroup()) {
|
if (obj->hasLazyGroup()) {
|
||||||
JS::RootedObject self(cx, this);
|
if (cx->compartment() != obj->compartment())
|
||||||
if (cx->compartment() != compartment())
|
|
||||||
MOZ_CRASH();
|
MOZ_CRASH();
|
||||||
return makeLazyGroup(cx, self);
|
return makeLazyGroup(cx, obj);
|
||||||
}
|
}
|
||||||
return group_;
|
return obj->group_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
|
|
||||||
|
|
@ -3488,8 +3488,8 @@ GroupOf(JSContext* cx, unsigned argc, JS::Value* vp)
|
||||||
JS_ReportErrorASCII(cx, "groupOf: object expected");
|
JS_ReportErrorASCII(cx, "groupOf: object expected");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
JSObject* obj = &args[0].toObject();
|
RootedObject obj(cx, &args[0].toObject());
|
||||||
ObjectGroup* group = obj->getGroup(cx);
|
ObjectGroup* group = JSObject::getGroup(cx, obj);
|
||||||
if (!group)
|
if (!group)
|
||||||
return false;
|
return false;
|
||||||
args.rval().set(JS_NumberValue(double(uintptr_t(group) >> 3)));
|
args.rval().set(JS_NumberValue(double(uintptr_t(group) >> 3)));
|
||||||
|
|
|
||||||
|
|
@ -344,7 +344,7 @@ ArrayBufferObject::detach(JSContext* cx, Handle<ArrayBufferObject*> buffer,
|
||||||
// Make sure the global object's group has been instantiated, so the
|
// Make sure the global object's group has been instantiated, so the
|
||||||
// flag change will be observed.
|
// flag change will be observed.
|
||||||
AutoEnterOOMUnsafeRegion oomUnsafe;
|
AutoEnterOOMUnsafeRegion oomUnsafe;
|
||||||
if (!cx->global()->getGroup(cx))
|
if (!JSObject::getGroup(cx, cx->global()))
|
||||||
oomUnsafe.crash("ArrayBufferObject::detach");
|
oomUnsafe.crash("ArrayBufferObject::detach");
|
||||||
MarkObjectGroupFlags(cx, cx->global(), OBJECT_FLAG_TYPED_OBJECT_HAS_DETACHED_BUFFER);
|
MarkObjectGroupFlags(cx, cx->global(), OBJECT_FLAG_TYPED_OBJECT_HAS_DETACHED_BUFFER);
|
||||||
cx->compartment()->detachedTypedObjects = 1;
|
cx->compartment()->detachedTypedObjects = 1;
|
||||||
|
|
|
||||||
|
|
@ -4725,7 +4725,8 @@ js::RunOnceScriptPrologue(JSContext* cx, HandleScript script)
|
||||||
|
|
||||||
// Force instantiation of the script's function's group to ensure the flag
|
// Force instantiation of the script's function's group to ensure the flag
|
||||||
// is preserved in type information.
|
// is preserved in type information.
|
||||||
if (!script->functionNonDelazifying()->getGroup(cx))
|
RootedFunction fun(cx, script->functionNonDelazifying());
|
||||||
|
if (!JSObject::getGroup(cx, fun))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MarkObjectGroupFlags(cx, script->functionNonDelazifying(), OBJECT_FLAG_RUNONCE_INVALIDATED);
|
MarkObjectGroupFlags(cx, script->functionNonDelazifying(), OBJECT_FLAG_RUNONCE_INVALIDATED);
|
||||||
|
|
|
||||||
|
|
@ -283,12 +283,13 @@ JSObject::splicePrototype(JSContext* cx, const Class* clasp, Handle<TaggedProto>
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Force type instantiation when splicing lazy group.
|
// Force type instantiation when splicing lazy group.
|
||||||
RootedObjectGroup group(cx, self->getGroup(cx));
|
RootedObjectGroup group(cx, JSObject::getGroup(cx, self));
|
||||||
if (!group)
|
if (!group)
|
||||||
return false;
|
return false;
|
||||||
RootedObjectGroup protoGroup(cx, nullptr);
|
RootedObjectGroup protoGroup(cx, nullptr);
|
||||||
if (proto.isObject()) {
|
if (proto.isObject()) {
|
||||||
protoGroup = proto.toObject()->getGroup(cx);
|
RootedObject protoObj(cx, proto.toObject());
|
||||||
|
protoGroup = JSObject::getGroup(cx, protoObj);
|
||||||
if (!protoGroup)
|
if (!protoGroup)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1319,7 +1319,8 @@ js::EnsureTrackPropertyTypes(JSContext* cx, JSObject* obj, jsid id)
|
||||||
AutoEnterAnalysis enter(cx);
|
AutoEnterAnalysis enter(cx);
|
||||||
if (obj->hasLazyGroup()) {
|
if (obj->hasLazyGroup()) {
|
||||||
AutoEnterOOMUnsafeRegion oomUnsafe;
|
AutoEnterOOMUnsafeRegion oomUnsafe;
|
||||||
if (!obj->getGroup(cx)) {
|
RootedObject objRoot(cx, obj);
|
||||||
|
if (!JSObject::getGroup(cx, objRoot)) {
|
||||||
oomUnsafe.crash("Could not allocate ObjectGroup in EnsureTrackPropertyTypes");
|
oomUnsafe.crash("Could not allocate ObjectGroup in EnsureTrackPropertyTypes");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1338,10 +1339,13 @@ HeapTypeSetKey::instantiate(JSContext* cx)
|
||||||
{
|
{
|
||||||
if (maybeTypes())
|
if (maybeTypes())
|
||||||
return true;
|
return true;
|
||||||
if (object()->isSingleton() && !object()->singleton()->getGroup(cx)) {
|
if (object()->isSingleton()) {
|
||||||
|
RootedObject obj(cx, object()->singleton());
|
||||||
|
if (!JSObject::getGroup(cx, obj)) {
|
||||||
cx->clearPendingException();
|
cx->clearPendingException();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
JSObject* obj = object()->isSingleton() ? object()->singleton() : nullptr;
|
JSObject* obj = object()->isSingleton() ? object()->singleton() : nullptr;
|
||||||
maybeTypes_ = object()->maybeGroup()->getProperty(cx, obj, id());
|
maybeTypes_ = object()->maybeGroup()->getProperty(cx, obj, id());
|
||||||
return maybeTypes_ != nullptr;
|
return maybeTypes_ != nullptr;
|
||||||
|
|
@ -3088,7 +3092,7 @@ js::AddClearDefiniteGetterSetterForPrototypeChain(JSContext* cx, ObjectGroup* gr
|
||||||
*/
|
*/
|
||||||
RootedObject proto(cx, group->proto().toObjectOrNull());
|
RootedObject proto(cx, group->proto().toObjectOrNull());
|
||||||
while (proto) {
|
while (proto) {
|
||||||
ObjectGroup* protoGroup = proto->getGroup(cx);
|
ObjectGroup* protoGroup = JSObject::getGroup(cx, proto);
|
||||||
if (!protoGroup) {
|
if (!protoGroup) {
|
||||||
cx->recoverFromOutOfMemory();
|
cx->recoverFromOutOfMemory();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue