Bug 1011007 - MTypedArrayLength hoisting test. r=jandem
authorJeff Walden <jwalden@mit.edu>
Fri, 16 May 2014 14:38:37 -0700
changeset 233278 fdbabd7946abf3e56d7e1ff7a4f4e20331937796
parent 233277 58f5bf899265f9055f7b78dfc46538504ffbcd5f
child 233279 b4c32d72735f23784bec6f544c8a5d1937fc92e6
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1011007
milestone35.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 1011007 - MTypedArrayLength hoisting test. r=jandem
js/src/jit-test/tests/ion/typedarray-length.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/typedarray-length.js
@@ -0,0 +1,25 @@
+function neuterEventually(arr, i, variant)
+{
+  with (arr)
+  {
+    // prevent inlining
+  }
+
+  if (i === 2000)
+    neuter(arr.buffer, variant);
+}
+
+function test(variant)
+{
+  var buf = new ArrayBuffer(1000);
+  var ta = new Int8Array(buf);
+
+  for (var i = 0; i < 2500; i++)
+  {
+    neuterEventually(ta, i, variant);
+    assertEq(ta.length, i >= 2000 ? 0 : 1000);
+  }
+}
+
+test("change-data");
+test("same-data");