js/src/jit-test/tests/jaeger/undoAdd.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1
michael@0 2 /* Test undoing addition in overflow paths when under heavy register pressure. */
michael@0 3
michael@0 4 function add1(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); }
michael@0 5 function add2(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); }
michael@0 6 function add3(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); }
michael@0 7 add1(0x7ffffff0, 100, 0, 0, 2147483732);
michael@0 8 add2(-1000, -0x80000000, 0, 0, -2147484648);
michael@0 9 add3(-0x80000000, -1000, 0, 0, -2147484648);
michael@0 10
michael@0 11 function cadd1(x, a, b, res) {
michael@0 12 var nres = res + 0;
michael@0 13 var nb = b + 0;
michael@0 14 var z = (x + a) + 1000;
michael@0 15 assertEq(z, nres + nb);
michael@0 16 }
michael@0 17 cadd1(0x7ffffff0, 0, 0, 2147484632);
michael@0 18
michael@0 19 function cadd2(x, a, b, res) {
michael@0 20 var nres = res + 0;
michael@0 21 var nb = b + 0;
michael@0 22 var z = (x + a) + (-0x80000000);
michael@0 23 assertEq(z, nres + nb);
michael@0 24 }
michael@0 25 cadd2(-1000, 0, 0, -2147484648);

mercurial