mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 933734 - Check for undefined properties before emitting typed stores to global objects.
This commit is contained in:
parent
3d83aa7a6f
commit
9c73373ad4
@ -6303,9 +6303,14 @@ IonBuilder::setStaticName(JSObject *staticObject, PropertyName *name)
|
||||
// If the property has a known type, we may be able to optimize typed stores by not
|
||||
// storing the type tag.
|
||||
MIRType slotType = MIRType_None;
|
||||
JSValueType knownType = property.knownTypeTag(constraints());
|
||||
if (knownType != JSVAL_TYPE_UNKNOWN)
|
||||
slotType = MIRTypeFromValueType(knownType);
|
||||
{
|
||||
Shape *shape = staticObject->nativeLookup(cx, id);
|
||||
if (!shape || !shape->hasSlot() || !staticObject->getSlot(shape->slot()).isUndefined()) {
|
||||
JSValueType knownType = property.knownTypeTag(constraints());
|
||||
if (knownType != JSVAL_TYPE_UNKNOWN)
|
||||
slotType = MIRTypeFromValueType(knownType);
|
||||
}
|
||||
}
|
||||
|
||||
bool needsBarrier = property.needsBarrier(constraints());
|
||||
return storeSlot(obj, property.maybeTypes()->definiteSlot(), NumFixedSlots(staticObject),
|
||||
|
Loading…
Reference in New Issue
Block a user