Bug 1469217 part 8 - Remove unnecessary array.length code in SetExistingProperty. r=anba
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 21 Jun 2018 11:05:43 +0200
changeset 477490 ac80efa3b134b2a7656802de860b85206faf556a
parent 477489 98710e23e09bb5445c7668fc69d9d6e1620b2a5b
child 477491 e63812d0465efa8efb86f290399e8a3ac7e08d76
push id9385
push userdluca@mozilla.com
push dateFri, 22 Jun 2018 15:47:18 +0000
treeherdermozilla-beta@82a9a1027e2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersanba
bugs1469217
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1469217 part 8 - Remove unnecessary array.length code in SetExistingProperty. r=anba
js/src/vm/NativeObject.cpp
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -2696,20 +2696,16 @@ SetExistingProperty(JSContext* cx, Handl
 
         // steps 5.c-f.
         if (receiver.isObject() && pobj == &receiver.toObject()) {
             // Pure optimization for the common case. There's no point performing
             // the lookup in step 5.c again, as our caller just did it for us. The
             // result is |shape|.
 
             // Steps 5.e.i-ii.
-            if (pobj->is<ArrayObject>() && id == NameToId(cx->names().length)) {
-                Rooted<ArrayObject*> arr(cx, &pobj->as<ArrayObject>());
-                return ArraySetLength(cx, arr, id, shape->attributes(), v, result);
-            }
             return NativeSetExistingDataProperty(cx, pobj, shape, v, result);
         }
 
         // Shadow pobj[id] by defining a new data property receiver[id].
         // Delegate everything to SetPropertyByDefining.
         return SetPropertyByDefining(cx, id, v, receiver, result);
     }