Bug 997973: Call typed array constructors with new in jit-tests; r=jandem
authorBenjamin Bouvier <benj@benj.me>
Fri, 24 Oct 2014 11:26:15 +0200
changeset 212098 420b72a2e9336b01128cf3f89d267406dfd60354
parent 212097 12391c6d3c12afe75e0c2fa218e3998c7ace9563
child 212099 b05a7ee5188ad58379d924f935b7b653d9560354
push id27697
push usercbook@mozilla.com
push dateFri, 24 Oct 2014 13:48:53 +0000
treeherdermozilla-central@de805196bbc4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs997973
milestone36.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 997973: Call typed array constructors with new in jit-tests; r=jandem
js/src/jit-test/tests/TypedObject/bug976697.js
js/src/jit-test/tests/auto-regress/bug609287.js
js/src/jit-test/tests/auto-regress/bug743000.js
js/src/jit-test/tests/basic/bug578041.js
js/src/jit-test/tests/basic/bug710947.js
js/src/jit-test/tests/basic/bug836601.js
js/src/jit-test/tests/basic/bug984766.js
js/src/jit-test/tests/basic/testBug606138.js
js/src/jit-test/tests/basic/testSlowNativeWithNullThis.js
js/src/jit-test/tests/basic/testTypedArrayInit.js
js/src/jit-test/tests/for-of/typedarrays-6.js
js/src/jit-test/tests/ion/bug1054753.js
js/src/jit-test/tests/ion/bug858586.js
js/src/jit-test/tests/jaeger/bug585341.js
js/src/jit-test/tests/parallel/bug1033115-2.js
js/src/jit-test/tests/parallel/bug983558.js
js/src/jit-test/tests/saved-stacks/asm-frames.js
--- a/js/src/jit-test/tests/TypedObject/bug976697.js
+++ b/js/src/jit-test/tests/TypedObject/bug976697.js
@@ -1,15 +1,15 @@
 // Test that instantiating a typed array on top of a neutered buffer
 // doesn't trip any asserts.
 //
 // Any copyright is dedicated to the Public Domain.
 // http://creativecommons.org/licenses/publicdomain/
 
-x = ArrayBuffer();
+x = new ArrayBuffer();
 neuter(x, "same-data");
-Uint32Array(x);
+new Uint32Array(x);
 gc();
 
-x = ArrayBuffer();
+x = new ArrayBuffer();
 neuter(x, "change-data");
-Uint32Array(x);
+new Uint32Array(x);
 gc();
--- a/js/src/jit-test/tests/auto-regress/bug609287.js
+++ b/js/src/jit-test/tests/auto-regress/bug609287.js
@@ -4,16 +4,16 @@
 // Flags:
 //
 f = eval("\
   (function() {\
     __proto__ = \
     Proxy.createFunction((\
     function() {\
       return {\
-        has: ArrayBuffer,\
+        has: new ArrayBuffer,\
       }\
     })\
     (\"\"), \
     JSON.parse\
     )\
   })\
 ")()
--- a/js/src/jit-test/tests/auto-regress/bug743000.js
+++ b/js/src/jit-test/tests/auto-regress/bug743000.js
@@ -1,4 +1,4 @@
 // Binary: cache/js-dbg-64-1da11a2bc5db-linux
 // Flags:
 //
-Int32Array(wrap(new Uint8ClampedArray))
+new Int32Array(wrap(new Uint8ClampedArray))
--- a/js/src/jit-test/tests/basic/bug578041.js
+++ b/js/src/jit-test/tests/basic/bug578041.js
@@ -1,3 +1,3 @@
-this.__defineGetter__('x', Float32Array);
+this.__defineGetter__('x', () => new Float32Array());
 with(this)
     x;
--- a/js/src/jit-test/tests/basic/bug710947.js
+++ b/js/src/jit-test/tests/basic/bug710947.js
@@ -1,8 +1,8 @@
 // |jit-test| allow-oom;
 function startTest() {
  if (typeof document != "object" 
     || !document.location.href.match(/jsreftest.html/))  {}
 };
 gczeal(4);
 startTest();
-ArrayBuffer( 8192 );
+new ArrayBuffer( 8192 );
--- a/js/src/jit-test/tests/basic/bug836601.js
+++ b/js/src/jit-test/tests/basic/bug836601.js
@@ -1,8 +1,8 @@
 // |jit-test| error: InternalError
 let k
 Proxy.createFunction(function() {
     return {
-        get: Uint32Array
+        get: (n) => new Uint32Array(n)
     }
 }(), decodeURIComponent) & k
 
--- a/js/src/jit-test/tests/basic/bug984766.js
+++ b/js/src/jit-test/tests/basic/bug984766.js
@@ -1,7 +1,7 @@
 
 for (var i = 0; i < 10; i++) {
-  x = ArrayBuffer(4)
+  x = new ArrayBuffer(4)
   x.f = (function() {})
-  Uint16Array(x).set(JSON.parse)
+  new Uint16Array(x).set(JSON.parse)
   gcslice()
 }
--- a/js/src/jit-test/tests/basic/testBug606138.js
+++ b/js/src/jit-test/tests/basic/testBug606138.js
@@ -1,3 +1,3 @@
 // The proxy is going to mutate thisv in place. InvokeSessionGuard should be
 // cool with that
-with(evalcx(''))[7, 8].map(Int16Array, [])
+with(evalcx(''))[7, 8].map((n) => new Int16Array(n), [])
--- a/js/src/jit-test/tests/basic/testSlowNativeWithNullThis.js
+++ b/js/src/jit-test/tests/basic/testSlowNativeWithNullThis.js
@@ -1,6 +1,6 @@
 x = 0
 for (a = 0; a < 3; a++) {
-    (function () {
+    new ((function () {
         return Float64Array
-    })()(x, 1)
+    })())(x, 1)
 }
--- a/js/src/jit-test/tests/basic/testTypedArrayInit.js
+++ b/js/src/jit-test/tests/basic/testTypedArrayInit.js
@@ -7,17 +7,17 @@ function f() {
                      Int16Array,
                      Uint16Array,
                      Int32Array,
                      Uint32Array,
                      Float32Array,
                      Float64Array ])
   {
     for (var len of [ 3, 30, 300, 3000, 30000 ]) {
-      var arr = ctor(len);
+      var arr = new ctor(len);
       for (var i = 0; i < arr.length; i++)
         assertEq(arr[i], 0, "index " + i + " of " + ctor.name + " len " + len);
     }
   }
 }
 
 f();
 f();
--- a/js/src/jit-test/tests/for-of/typedarrays-6.js
+++ b/js/src/jit-test/tests/for-of/typedarrays-6.js
@@ -1,9 +1,9 @@
 // for-of can iterate over float typed arrays containing infinities or NaNs.
 
 var values = [Infinity, -Infinity, -0, NaN];
 for (var C of [Float32Array, Float64Array]) {
     var i = 0;
-    for (var v of C(values))
+    for (var v of new C(values))
         assertEq(v, values[i++]);
     assertEq(i, values.length);
 }
--- a/js/src/jit-test/tests/ion/bug1054753.js
+++ b/js/src/jit-test/tests/ion/bug1054753.js
@@ -1,12 +1,12 @@
 // |jit-test| error: TypeError
 if (typeof Symbol === "function") {
     g = (function() {
-        var Int32ArrayView = Int32Array();
+        var Int32ArrayView = new Int32Array();
         function f() {
             Int32ArrayView[Symbol() >> 2]
         }
         return f;
     })();
     try {
         g();
     } catch (e) {}
--- a/js/src/jit-test/tests/ion/bug858586.js
+++ b/js/src/jit-test/tests/ion/bug858586.js
@@ -9,15 +9,15 @@ function makeArray(n) {
     for (var i = 0; i < n; i++) {
         arr.push(new classes[i % 3](i % 3));
     }
     return arr;
 }
 function runner(arr, resultArray, len) {
     for (var i = 0; i < len; i++) {
         var obj = arr[i];
-        resultArray[0] += obj.foo(i);
+        resultArray[0] += new obj.foo(i);
     }
 }
 var resultArray = [0];
 var arr = makeArray(30000);
 C.prototype.foo = Uint8ClampedArray;
 runner(arr, resultArray, 30000);
--- a/js/src/jit-test/tests/jaeger/bug585341.js
+++ b/js/src/jit-test/tests/jaeger/bug585341.js
@@ -1,6 +1,6 @@
-this.__defineGetter__("x", Float64Array)
+this.__defineGetter__("x", () => new Float64Array())
 Function("\
   with(this) {\
     eval(\"x\")\
   }\
 ")()
--- a/js/src/jit-test/tests/parallel/bug1033115-2.js
+++ b/js/src/jit-test/tests/parallel/bug1033115-2.js
@@ -4,18 +4,18 @@
 if (!getBuildConfiguration().parallelJS)
   quit(0);
 
 x = [];
 y = x.mapPar(function() {});
 Object.defineProperty(y, 3, {
     get: (function( ... $8)  {
         try {
-            Int8Array(y);
+            new Int8Array(y);
             x.reducePar(function() function q() 1);
         } catch (e) {}
     })
 });
 var x = [1,2,3];
-function rsh() { 
- return y.toSource() >> 2.0; 
+function rsh() {
+ return y.toSource() >> 2.0;
 }
 rsh();
--- a/js/src/jit-test/tests/parallel/bug983558.js
+++ b/js/src/jit-test/tests/parallel/bug983558.js
@@ -2,14 +2,14 @@ if (!getBuildConfiguration().parallelJS)
   quit(0);
 
 x = [];
 Array.prototype.push.call(x, 2);
 y = x.mapPar(function() {});
 Object.defineProperty(y, 3, {
     get: (function() {
         try {
-            Int8Array(y);
+            new Int8Array(y);
             x.reducePar(function() {});
         } catch (e) { print(e); }
     })
 });
 y + '';
--- a/js/src/jit-test/tests/saved-stacks/asm-frames.js
+++ b/js/src/jit-test/tests/saved-stacks/asm-frames.js
@@ -14,17 +14,17 @@ function AsmModule(stdlib, foreign, heap
 }
 
 let stack;
 
 function tester() {
   stack = saveStack();
 }
 
-const buf = ArrayBuffer(1024*8);
+const buf = new ArrayBuffer(1024*8);
 const module = AsmModule(this, { t: tester }, buf);
 module.test();
 
 print(stack);
 assertEq(stack.functionDisplayName, "tester");
 
 assertEq(stack.parent.functionDisplayName, "doTest");
 assertEq(stack.parent.line, 6);