Bug 1283334 - Part 5: Do not sparsify dense arrays when freezing - Tests. r=jandem
☠☠ backed out by c945b9db2501 ☠ ☠
authorLeo Gaspard <leo@gaspard.io>
Tue, 23 Aug 2016 19:02:06 -0700
changeset 407018 45c2fde6056f8523e7077646e2c04f5ca362810f
parent 407017 2b1e3fea4384044cfcf3d93a94bc34ff45c15d18
child 407019 eb085490560d00d0d2863695df142b3b6277c759
push id27893
push userbmo:gasolin@mozilla.com
push dateTue, 30 Aug 2016 03:41:38 +0000
reviewersjandem
bugs1283334
milestone51.0a1
Bug 1283334 - Part 5: Do not sparsify dense arrays when freezing - Tests. r=jandem
js/src/jit-test/tests/basic/define-frozen-dense-strict.js
js/src/jit-test/tests/basic/define-frozen-dense.js
js/src/jit-test/tests/basic/define-frozen-property-strict.js
js/src/jit-test/tests/basic/define-frozen-property.js
js/src/jit-test/tests/basic/write-frozen-dense-strict-inlinecache.js
js/src/jit-test/tests/basic/write-frozen-dense-strict.js
js/src/jit-test/tests/basic/write-frozen-dense.js
js/src/jit-test/tests/basic/write-frozen-property-strict.js
js/src/jit-test/tests/basic/write-frozen-property.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/define-frozen-dense-strict.js
@@ -0,0 +1,16 @@
+"use strict";
+var t = [4];
+var stop;
+Object.freeze(t);
+do {
+    let ok = false;
+    stop = inIon();
+    try {
+        t[1] = 2;
+    } catch(e) {
+        ok = true;
+    }
+    assertEq(ok, true);
+    assertEq(t.length, 1);
+    assertEq(t[1], undefined);
+} while (!stop);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/define-frozen-dense.js
@@ -0,0 +1,9 @@
+var t = [4];
+var stop;
+Object.freeze(t);
+do {
+    stop = inIon();
+    t[1] = 2;
+    assertEq(t.length, 1);
+    assertEq(t[1], undefined);
+} while (!stop);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/define-frozen-property-strict.js
@@ -0,0 +1,14 @@
+function foo(x) {
+  "use strict";
+  var ok = false;
+  try {
+    x.c = 10;
+  } catch(e) {
+    ok = true;
+  }
+  assertEq(ok, true);
+  assertEq(x.c, undefined);
+}
+x = {a:0,b:1};
+Object.freeze(x);
+foo(x);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/define-frozen-property.js
@@ -0,0 +1,7 @@
+function foo(x) {
+  x.c = 10;
+  assertEq(x.c, undefined);
+}
+x = {a:0,b:1};
+Object.freeze(x);
+foo(x);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/write-frozen-dense-strict-inlinecache.js
@@ -0,0 +1,20 @@
+// |jit-test| --no-threads; --ion-eager; --ion-shared-stubs=off
+setJitCompilerOption('ion.forceinlineCaches', 1);
+function foo(t) {
+    "use strict";
+    var stop;
+    do {
+        let ok = false;
+        stop = inIon();
+        try {
+            t[0] = 2;
+        } catch(e) {
+            ok = true;
+        }
+        assertEq(ok, true);
+    } while (!stop);
+}
+var t = [4];
+Object.freeze(t);
+foo(t);
+foo(t);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/write-frozen-dense-strict.js
@@ -0,0 +1,14 @@
+"use strict";
+var t = [4];
+var stop;
+Object.freeze(t);
+do {
+    let ok = false;
+    stop = inIon();
+    try {
+        t[0] = 2;
+    } catch(e) {
+        ok = true;
+    }
+    assertEq(ok, true);
+} while (!stop);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/write-frozen-dense.js
@@ -0,0 +1,8 @@
+var t = [4];
+var stop;
+Object.freeze(t);
+do {
+    stop = inIon();
+    t[0] = 2;
+    assertEq(t[0], 4);
+} while (!stop);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/write-frozen-property-strict.js
@@ -0,0 +1,14 @@
+function foo(x) {
+  "use strict";
+  var ok = false;
+  try {
+    x.a = 10;
+  } catch(e) {
+    ok = true;
+  }
+  assertEq(ok, true);
+  assertEq(x.a, 0);
+}
+x = {a:0,b:1};
+Object.freeze(x);
+foo(x);
--- a/js/src/jit-test/tests/basic/write-frozen-property.js
+++ b/js/src/jit-test/tests/basic/write-frozen-property.js
@@ -1,8 +1,7 @@
-
 function foo(x) {
   x.a = 10;
   assertEq(x.a, 0);
 }
 x = {a:0,b:1};
 Object.freeze(x);
 foo(x);