summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/recompile/incdec.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/jit-test/tests/jaeger/recompile/incdec.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/jit-test/tests/jaeger/recompile/incdec.js')
-rw-r--r--js/src/jit-test/tests/jaeger/recompile/incdec.js92
1 files changed, 92 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/jaeger/recompile/incdec.js b/js/src/jit-test/tests/jaeger/recompile/incdec.js
new file mode 100644
index 000000000..93786ba34
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/recompile/incdec.js
@@ -0,0 +1,92 @@
+
+/* Handle recompilation on overflow of inc/dec operations. */
+
+function local()
+{
+ var j = 0x7ffffff0;
+ for (var i = 0; i < 100; i++)
+ j++;
+ assertEq(j, 2147483732);
+}
+local();
+
+function olocal()
+{
+ var j = 0x7ffffff0;
+ for (var i = 0; i < 100; i++) {
+ if (j++ == 5000)
+ break;
+ }
+ assertEq(j, 2147483732);
+}
+olocal();
+
+function arg(j)
+{
+ for (var i = 0; i < 100; i++)
+ j++;
+ assertEq(j, 2147483732);
+}
+arg(0x7ffffff0);
+
+function oarg(j)
+{
+ for (var i = 0; i < 100; i++) {
+ if (j++ == 5000)
+ break;
+ }
+ assertEq(j, 2147483732);
+}
+oarg(0x7ffffff0);
+
+// basic global inc/dec correctness
+var x = 1.23;
+x = x--;
+x = x++;
+x = ++x;
+x = --x;
+assertEq(x, 1.23);
+
+var g = 0x7ffffff0;
+function glob()
+{
+ for (var i = 0; i < 100; i++)
+ g++;
+ assertEq(g, 2147483732);
+}
+glob();
+
+function gname()
+{
+ n = 0x7ffffff0;
+ for (var i = 0; i < 100; i++)
+ n++;
+ assertEq(n, 2147483732);
+}
+gname();
+
+function prop()
+{
+ var v = {f: 0x7ffffff0};
+ for (var i = 0; i < 100; i++)
+ v.f++;
+ assertEq(v.f, 2147483732);
+}
+prop();
+
+function elem(v, f)
+{
+ for (var i = 0; i < 100; i++)
+ v[f]++;
+ assertEq(v.f, 2147483732);
+}
+elem({f: 0x7ffffff0}, "f");
+
+function name()
+{
+ var v = 0x7ffffff0;
+ var i;
+ eval("for (i = 0; i < 100; i++) v++");
+ assertEq(v + 10, 2147483742);
+}
+name();