js/src/jit-test/tests/ion/bug860838-4.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 function DiagModule(stdlib, foreign) {
     2     "use asm";
     4     var sqrt = stdlib.Math.sqrt;
     5     var test = foreign.test;
     6     var foo = foreign.foo;
     8     function square(x) {
     9         x = x|0;
    10         return ((x|0)+(x|0))|0;
    11     }
    13     function diag() {
    14         var x = 0.0;
    15         while(1) {
    16           test(1, x);
    17           x = x+1.0
    18           if (x > 15.0)
    19             return 0;
    20         }
    21         return 0;
    22     }
    24     function diag_1() {
    25         foo();
    26         return 0;
    27     }
    30     return { diag: diag, diag_1:diag_1 };
    31 }
    33 var foreign = {
    34   test:function(a,b) {
    35     print(a+":"+b)
    36     var c = [0.0];
    37     if (b > 10)
    38         return c[1];
    39     return c[0];
    40   },
    41   foo:function() {
    42     with({}) {};
    43     gc();
    44   }
    45 }
    47 // make sure foreign is compiled
    49 var fast = DiagModule(this, foreign);     // produces AOT-compiled version
    50 print(fast.diag_1());      // 5
    51 gc()
    52 print(fast.diag());      // 5

mercurial