js/src/jit-test/tests/ion/bug860838.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.

     1 enableOsiPointRegisterChecks();
     3 function DiagModule(stdlib, foreign) {
     4     "use asm";
     6     var sqrt = stdlib.Math.sqrt;
     7     var test = foreign.test;
     9     function square(x) {
    10         x = x|0;
    11         return ((x|0)+(x|0))|0;
    12     }
    14     function diag() {
    15         var x = 0.0;
    16         while(1) {
    17           test(1, x);
    18           x = x+1.0
    19           if (x > 15.0)
    20             return 0;
    21         }
    22         return 0;
    23     }
    25     function diag_1() {
    26           test();
    27         return 0;
    28     }
    31     return { diag: diag, diag_1:diag_1 };
    32 }
    34 var foreign = {
    35   test:function(a,b) {
    36     print(a+":"+b)
    37     var c = [0.0];
    38     if (b > 10)
    39         return c[1];
    40     return c[0];
    41   }
    42 }
    44 // make sure foreign is compiled
    46 var fast = DiagModule(this, foreign);     // produces AOT-compiled version
    47 print(fast.diag());      // 5
    48 gc()
    49 print(fast.diag());      // 5

mercurial