diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-20 12:56:32 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-20 12:56:32 +0200 |
commit | 32d13a1648a64fe26be66de026bffca8c1afa88f (patch) | |
tree | becd2a6ab5304e14657c6f8c0acf27aaad1ed03d /js/src/jit/MCallOptimize.cpp | |
parent | 276f6583e00edf2a217a3092471ca2aa3aab5a09 (diff) | |
download | UXP-32d13a1648a64fe26be66de026bffca8c1afa88f.tar UXP-32d13a1648a64fe26be66de026bffca8c1afa88f.tar.gz UXP-32d13a1648a64fe26be66de026bffca8c1afa88f.tar.lz UXP-32d13a1648a64fe26be66de026bffca8c1afa88f.tar.xz UXP-32d13a1648a64fe26be66de026bffca8c1afa88f.zip |
Call a more generic function when inlining array natives.
This simplifies the code a bit because
ElementAccessHasExtraIndexedProperty checks for length-overflow
(directly) and sparse-indexes (through TypeCanHaveExtraIndexedProperties)
so the callers don't have to do that anymore.
Diffstat (limited to 'js/src/jit/MCallOptimize.cpp')
-rw-r--r-- | js/src/jit/MCallOptimize.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp index 0d5779cee..fed5aefe5 100644 --- a/js/src/jit/MCallOptimize.cpp +++ b/js/src/jit/MCallOptimize.cpp @@ -621,7 +621,8 @@ IonBuilder::inlineArrayPopShift(CallInfo& callInfo, MArrayPopShift::Mode mode) 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); return InliningStatus_NotInlined; } @@ -748,14 +749,8 @@ IonBuilder::inlineArrayPush(CallInfo& callInfo) const Class* clasp = thisTypes->getKnownClass(constraints()); if (clasp != &ArrayObject::class_) 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); return InliningStatus_NotInlined; } @@ -825,15 +820,9 @@ IonBuilder::inlineArraySlice(CallInfo& callInfo) const Class* clasp = thisTypes->getKnownClass(constraints()); if (clasp != &ArrayObject::class_) 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. - if (ArrayPrototypeHasIndexedProperty(this, script())) { + // Watch out for indexed properties on the object or its prototype. + if (ElementAccessHasExtraIndexedProperty(this, obj)) { trackOptimizationOutcome(TrackedOutcome::ProtoIndexedProps); return InliningStatus_NotInlined; } |