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.

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

mercurial