mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
ported mozilla upstream change: Bug 1544386 part 1 - Call ElementAccessHasExtraIndexedProperty instead of ArrayPrototypeHasIndexedProperty when inlining array natives. r=tcampbell a=lizzard (MFSA2019-18)
This commit is contained in:
parent
be20c640d4
commit
993fcca963
3 changed files with 5 additions and 26 deletions
|
|
@ -621,7 +621,8 @@ IonBuilder::inlineArrayPopShift(CallInfo& callInfo, MArrayPopShift::Mode mode)
|
||||||
return InliningStatus_NotInlined;
|
return InliningStatus_NotInlined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ArrayPrototypeHasIndexedProperty(this, script())) {
|
// Watch out for extra indexed properties on the object or its prototype.
|
||||||
|
if (ElementAccessHasExtraIndexedProperty(this, obj)) {
|
||||||
trackOptimizationOutcome(TrackedOutcome::ProtoIndexedProps);
|
trackOptimizationOutcome(TrackedOutcome::ProtoIndexedProps);
|
||||||
return InliningStatus_NotInlined;
|
return InliningStatus_NotInlined;
|
||||||
}
|
}
|
||||||
|
|
@ -748,14 +749,8 @@ IonBuilder::inlineArrayPush(CallInfo& callInfo)
|
||||||
const Class* clasp = thisTypes->getKnownClass(constraints());
|
const Class* clasp = thisTypes->getKnownClass(constraints());
|
||||||
if (clasp != &ArrayObject::class_)
|
if (clasp != &ArrayObject::class_)
|
||||||
return InliningStatus_NotInlined;
|
return InliningStatus_NotInlined;
|
||||||
if (thisTypes->hasObjectFlags(constraints(), OBJECT_FLAG_SPARSE_INDEXES |
|
|
||||||
OBJECT_FLAG_LENGTH_OVERFLOW))
|
|
||||||
{
|
|
||||||
trackOptimizationOutcome(TrackedOutcome::ArrayBadFlags);
|
|
||||||
return InliningStatus_NotInlined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ArrayPrototypeHasIndexedProperty(this, script())) {
|
if (ElementAccessHasExtraIndexedProperty(this, obj)) {
|
||||||
trackOptimizationOutcome(TrackedOutcome::ProtoIndexedProps);
|
trackOptimizationOutcome(TrackedOutcome::ProtoIndexedProps);
|
||||||
return InliningStatus_NotInlined;
|
return InliningStatus_NotInlined;
|
||||||
}
|
}
|
||||||
|
|
@ -825,15 +820,9 @@ IonBuilder::inlineArraySlice(CallInfo& callInfo)
|
||||||
const Class* clasp = thisTypes->getKnownClass(constraints());
|
const Class* clasp = thisTypes->getKnownClass(constraints());
|
||||||
if (clasp != &ArrayObject::class_)
|
if (clasp != &ArrayObject::class_)
|
||||||
return InliningStatus_NotInlined;
|
return InliningStatus_NotInlined;
|
||||||
if (thisTypes->hasObjectFlags(constraints(), OBJECT_FLAG_SPARSE_INDEXES |
|
|
||||||
OBJECT_FLAG_LENGTH_OVERFLOW))
|
|
||||||
{
|
|
||||||
trackOptimizationOutcome(TrackedOutcome::ArrayBadFlags);
|
|
||||||
return InliningStatus_NotInlined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Watch out for indexed properties on the prototype.
|
// Watch out for extra indexed properties on the object or its prototype.
|
||||||
if (ArrayPrototypeHasIndexedProperty(this, script())) {
|
if (ElementAccessHasExtraIndexedProperty(this, obj)) {
|
||||||
trackOptimizationOutcome(TrackedOutcome::ProtoIndexedProps);
|
trackOptimizationOutcome(TrackedOutcome::ProtoIndexedProps);
|
||||||
return InliningStatus_NotInlined;
|
return InliningStatus_NotInlined;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6221,15 +6221,6 @@ PrototypeHasIndexedProperty(IonBuilder* builder, JSObject* obj)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Whether Array.prototype, or an object on its proto chain, has an indexed property.
|
|
||||||
bool
|
|
||||||
jit::ArrayPrototypeHasIndexedProperty(IonBuilder* builder, JSScript* script)
|
|
||||||
{
|
|
||||||
if (JSObject* proto = script->global().maybeGetArrayPrototype())
|
|
||||||
return PrototypeHasIndexedProperty(builder, proto);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Whether obj or any of its prototypes have an indexed property.
|
// Whether obj or any of its prototypes have an indexed property.
|
||||||
bool
|
bool
|
||||||
jit::TypeCanHaveExtraIndexedProperties(IonBuilder* builder, TemporaryTypeSet* types)
|
jit::TypeCanHaveExtraIndexedProperties(IonBuilder* builder, TemporaryTypeSet* types)
|
||||||
|
|
|
||||||
|
|
@ -14054,7 +14054,6 @@ bool PropertyWriteNeedsTypeBarrier(TempAllocator& alloc, CompilerConstraintList*
|
||||||
MBasicBlock* current, MDefinition** pobj,
|
MBasicBlock* current, MDefinition** pobj,
|
||||||
PropertyName* name, MDefinition** pvalue,
|
PropertyName* name, MDefinition** pvalue,
|
||||||
bool canModify, MIRType implicitType = MIRType::None);
|
bool canModify, MIRType implicitType = MIRType::None);
|
||||||
bool ArrayPrototypeHasIndexedProperty(IonBuilder* builder, JSScript* script);
|
|
||||||
bool TypeCanHaveExtraIndexedProperties(IonBuilder* builder, TemporaryTypeSet* types);
|
bool TypeCanHaveExtraIndexedProperties(IonBuilder* builder, TemporaryTypeSet* types);
|
||||||
|
|
||||||
inline MIRType
|
inline MIRType
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue