Bug 995679 - Test for length-inlining code invalidation on ArrayBuffer neutering. r=sfink
authorJeff Walden <jwalden@mit.edu>
Thu, 24 Apr 2014 22:33:13 -0600
changeset 210061 119a19ebe6d3
parent 210060 9ffc95fd87d3
child 210062 58f5bf899265
push id27637
push usercbook@mozilla.com
push dateMon, 13 Oct 2014 11:14:20 +0000
treeherdermozilla-central@9ed77991d70f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs995679
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 995679 - Test for length-inlining code invalidation on ArrayBuffer neutering. r=sfink
js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/inlining/typedarray-length-inlining-neuter.js
@@ -0,0 +1,42 @@
+var INLINE_INT8_AMOUNT = 4;
+var OUT_OF_LINE_INT8_AMOUNT = 237;
+
+// Small and inline
+
+// Neutering and replacing data.
+var ab1 = new ArrayBuffer(INLINE_INT8_AMOUNT);
+var ta1 = new Int8Array(ab1);
+function q1() { return ta1.length; }
+q1();
+q1();
+neuter(ab1, "change-data");
+assertEq(q1(), 0);
+
+// Neutering preserving data pointer.
+var ab2 = new ArrayBuffer(INLINE_INT8_AMOUNT);
+var ta2 = new Int8Array(ab2);
+function q2() { return ta2.length; }
+q2();
+q2();
+neuter(ab2, "same-data");
+assertEq(q2(), 0);
+
+// Large and out-of-line
+
+// Neutering and replacing data.
+var ab3 = new ArrayBuffer(OUT_OF_LINE_INT8_AMOUNT);
+var ta3 = new Int8Array(ab3);
+function q3() { return ta3.length; }
+q3();
+q3();
+neuter(ab3, "change-data");
+assertEq(q3(), 0);
+
+// Neutering preserving data pointer.
+var ab4 = new ArrayBuffer(OUT_OF_LINE_INT8_AMOUNT);
+var ta4 = new Int8Array(ab4);
+function q4() { return ta4.length; }
+q4();
+q4();
+neuter(ab4, "same-data");
+assertEq(q4(), 0);