Bug 1558914 - Disable Array generics in Nightly. r=jandem
☠☠ backed out by f4d39862a9ad ☠ ☠
authorTom Schuster <evilpies@gmail.com>
Mon, 01 Jul 2019 12:52:59 +0000
changeset 543644 e7fbcb7b6694db694f701e28105239d93c6d0b4a
parent 543643 d2b5726bfce4a2c4f6ccfbe72f0d7d7dedebe593
child 543645 ac7ca81ef7c639341078af47effafdd82b5c7445
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1558914
milestone69.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 1558914 - Disable Array generics in Nightly. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D35541
js/src/builtin/Array.cpp
js/src/jit-test/tests/auto-regress/bug811616.js
js/src/jit-test/tests/basic/arrayNatives.js
js/src/jit-test/tests/basic/bug830967.js
js/src/jit-test/tests/jaeger/recompile/bug656753.js
js/src/jit-test/tests/jaeger/recompile/exotic.js
js/src/jit-test/tests/self-hosting/alternate-static-and-instance-array-extras.js
js/src/tests/non262/Array/generics.js
js/src/tests/non262/Array/regress-313153.js
js/src/tests/non262/Array/regress-415540.js
js/src/tests/non262/extensions/regress-312385-01.js
js/src/tests/non262/extensions/regress-355497.js
js/src/tests/non262/extensions/typedarray-set-neutering.js
js/xpconnect/tests/chrome/test_xrayToJS.xul
--- a/js/src/builtin/Array.cpp
+++ b/js/src/builtin/Array.cpp
@@ -3776,16 +3776,17 @@ static const JSFunctionSpec array_method
     /* Future additions */
     JS_SELF_HOSTED_FN("flatMap", "ArrayFlatMap", 1, 0),
     JS_SELF_HOSTED_FN("flat", "ArrayFlat", 0, 0),
 
     JS_FS_END};
 
 static const JSFunctionSpec array_static_methods[] = {
     JS_INLINABLE_FN("isArray", array_isArray, 1, 0, ArrayIsArray),
+#ifndef NIGHTLY_BUILD
     JS_SELF_HOSTED_FN("concat", "ArrayStaticConcat", 2, 0),
     JS_SELF_HOSTED_FN("lastIndexOf", "ArrayStaticLastIndexOf", 2, 0),
     JS_SELF_HOSTED_FN("indexOf", "ArrayStaticIndexOf", 2, 0),
     JS_SELF_HOSTED_FN("forEach", "ArrayStaticForEach", 2, 0),
     JS_SELF_HOSTED_FN("map", "ArrayStaticMap", 2, 0),
     JS_SELF_HOSTED_FN("filter", "ArrayStaticFilter", 2, 0),
     JS_SELF_HOSTED_FN("every", "ArrayStaticEvery", 2, 0),
     JS_SELF_HOSTED_FN("some", "ArrayStaticSome", 2, 0),
@@ -3795,16 +3796,17 @@ static const JSFunctionSpec array_static
     JS_SELF_HOSTED_FN("reverse", "ArrayStaticReverse", 1, 0),
     JS_SELF_HOSTED_FN("sort", "ArrayStaticSort", 2, 0),
     JS_SELF_HOSTED_FN("push", "ArrayStaticPush", 2, 0),
     JS_SELF_HOSTED_FN("pop", "ArrayStaticPop", 1, 0),
     JS_SELF_HOSTED_FN("shift", "ArrayStaticShift", 1, 0),
     JS_SELF_HOSTED_FN("unshift", "ArrayStaticUnshift", 2, 0),
     JS_SELF_HOSTED_FN("splice", "ArrayStaticSplice", 3, 0),
     JS_SELF_HOSTED_FN("slice", "ArrayStaticSlice", 3, 0),
+#endif
     JS_SELF_HOSTED_FN("from", "ArrayFrom", 3, 0),
     JS_FN("of", array_of, 0, 0),
 
     JS_FS_END};
 
 const JSPropertySpec array_static_props[] = {
     JS_SELF_HOSTED_SYM_GET(species, "$ArraySpecies", 0), JS_PS_END};
 
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug811616.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// |jit-test| error:TypeError
-
-// Binary: cache/js-dbg-64-4e9567eeb09e-linux
-// Flags: --ion-eager
-//
-"".replace(RegExp(), Array.reduce)
--- a/js/src/jit-test/tests/basic/arrayNatives.js
+++ b/js/src/jit-test/tests/basic/arrayNatives.js
@@ -1,9 +1,9 @@
-
+// |jit-test| skip-if: !(getBuildConfiguration().release_or_beta)
 /* Array natives applied to non-arrays. */
 
 var oa = {};
 Array.pop(oa);
 assertEq(oa.length, 0);
 
 var ob = {};
 Array.push(ob, "twelve");
--- a/js/src/jit-test/tests/basic/bug830967.js
+++ b/js/src/jit-test/tests/basic/bug830967.js
@@ -1,4 +1,4 @@
-var x = Array.concat(Object.freeze([{}]));
+var x = Array.prototype.concat.call(Object.freeze([{}]));
 assertEq(x.length, 1);
 assertEq(0 in x, true);
 assertEq(JSON.stringify(x[0]), "{}");
deleted file mode 100644
--- a/js/src/jit-test/tests/jaeger/recompile/bug656753.js
+++ /dev/null
@@ -1,20 +0,0 @@
-
-var global = 0;
-
-function foo(i) {
-  global = i;
-  if (global == 8) {
-    eval("global = 'three'");
-    throw global;
-  }
-}
-
-var caught = false;
-try {
-  for (var i = 0; i < 10; i++) {
-    Array.map([i], foo);
- }
-} catch (e) { caught = true; }
-
-assertEq(caught, true);
-assertEq(global, 'three');
--- a/js/src/jit-test/tests/jaeger/recompile/exotic.js
+++ b/js/src/jit-test/tests/jaeger/recompile/exotic.js
@@ -1,21 +1,11 @@
 
 // Test exotic ways of triggering recompilation.
 
-// Lowered native call.
-
-var x = 0;
-var y = true;
-for (var i = 0; i < 20; i++) {
-  x += Array.map.apply(undefined, [[0], function(x) { if (i == 10) eval("y = 20"); return 1; }])[0];
-}
-assertEq(x, 20);
-assertEq(y, 20);
-
 // Recompilation triggered by local function.
 
 var o = {};
 function what(q) {
   function inner() { return q; }
   o.f = inner;
   var a = o.f();
   return a;
--- a/js/src/jit-test/tests/self-hosting/alternate-static-and-instance-array-extras.js
+++ b/js/src/jit-test/tests/self-hosting/alternate-static-and-instance-array-extras.js
@@ -1,3 +1,4 @@
+// |jit-test| skip-if: !(getBuildConfiguration().release_or_beta)
 actual = Array.indexOf([]);
 actual += [].indexOf();
 actual += Array.indexOf([]);
\ No newline at end of file
--- a/js/src/tests/non262/Array/generics.js
+++ b/js/src/tests/non262/Array/generics.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(!Array.hasOwnProperty("slice"))
 var BUGNUMBER = 1263558;
 var summary = "Self-host all Array generics.";
 
 print(BUGNUMBER + ": " + summary);
 
 var arr, arrLike, tmp, f;
 
 function reset() {
--- a/js/src/tests/non262/Array/regress-313153.js
+++ b/js/src/tests/non262/Array/regress-313153.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(!Array.hasOwnProperty("concat"))
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 313153;
 var summary = 'generic native method dispatcher extra actual arguments';
--- a/js/src/tests/non262/Array/regress-415540.js
+++ b/js/src/tests/non262/Array/regress-415540.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(!Array.hasOwnProperty("push"))
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 415540;
 var summary = 'Array.push'
--- a/js/src/tests/non262/extensions/regress-312385-01.js
+++ b/js/src/tests/non262/extensions/regress-312385-01.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(!Array.hasOwnProperty("slice"))
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 312385;
 var summary = 'Generic methods with null or undefined |this|';
--- a/js/src/tests/non262/extensions/regress-355497.js
+++ b/js/src/tests/non262/extensions/regress-355497.js
@@ -30,17 +30,17 @@ function test()
   {
     actual = ex + '';
   }
   reportCompare(expect, actual, summary + ': 1');
 
   try
   {
     var b = { length: 1 };
-    b.__defineGetter__(0, function () { return Array.slice(b);});
+    b.__defineGetter__(0, function () { return Array.prototype.slice.call(b); });
     b[0];
   }
   catch(ex)
   {
     actual = ex + '';
   }
   reportCompare(expect, actual, summary + ': 2');
 
--- a/js/src/tests/non262/extensions/typedarray-set-neutering.js
+++ b/js/src/tests/non262/extensions/typedarray-set-neutering.js
@@ -32,17 +32,14 @@ Object.defineProperty(src, 4, {
     detachArrayBuffer(ab);
     gc();
     return 200;
   }
 });
 
 assertThrowsInstanceOf(() => a.set(src), TypeError);
 
-// Not really needed
-Array.reverse(a_2);
-
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
 
 print("Tests complete");
--- a/js/xpconnect/tests/chrome/test_xrayToJS.xul
+++ b/js/xpconnect/tests/chrome/test_xrayToJS.xul
@@ -206,21 +206,22 @@ https://bugzilla.mozilla.org/show_bug.cg
                       "entries", "isExtensible"]);
   gPrototypeProperties['Array'] =
     ["length", "toSource", "toString", "toLocaleString", "join", "reverse", "sort", "push",
       "pop", "shift", "unshift", "splice", "concat", "slice", "lastIndexOf", "indexOf",
       "includes", "forEach", "map", "reduce", "reduceRight", "filter", "some", "every", "find",
       "findIndex", "copyWithin", "fill", Symbol.iterator, Symbol.unscopables, "entries", "keys",
       "values", "constructor", "flat", "flatMap"];
   gConstructorProperties['Array'] =
-    constructorProps(["join", "reverse", "sort", "push", "pop", "shift",
-                      "unshift", "splice", "concat", "slice", "isArray",
-                      "lastIndexOf", "indexOf", "forEach", "map", "filter",
-                      "every", "some", "reduce", "reduceRight", "from", "of",
-                      Symbol.species]);
+    constructorProps(["isArray", "from", "of", Symbol.species]);
+  if (isReleaseOrBeta) {
+    gConstructorProperties['Array'].push("join", "reverse", "sort", "push", "pop", "shift",
+                                         "unshift", "splice", "concat", "slice", "lastIndexOf", "indexOf", "forEach", "map", "filter",
+                                         "every", "some", "reduce", "reduceRight");
+  }
   for (var c of typedArrayClasses) {
     gPrototypeProperties[c] = ["constructor", "BYTES_PER_ELEMENT"];
     gConstructorProperties[c] = constructorProps(["BYTES_PER_ELEMENT"]);
   }
   gPrototypeProperties['TypedArray'] =
     ["length", "buffer", "byteLength", "byteOffset", Symbol.iterator, "subarray",
      "set", "copyWithin", "find", "findIndex", "forEach","indexOf", "lastIndexOf", "includes",
      "reverse", "join", "every", "some", "reduce", "reduceRight", "entries", "keys", "values",