js/src/jit-test/tests/basic/testSlowArrayPopNestedTrees.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 // Same thing but nested trees, each reconstructing one or more stack frames 
     2 // (so, several functions with loops, such that the loops end up being
     3 // nested though they are not lexically nested)
     5 function testSlowArrayPopNestedTrees() {    
     6     var a = [];
     7     for (var i = 0; i < 9; i++)
     8         a[i] = [0];
     9     a[8].__defineGetter__("0", function () { return 3.14159 });
    11     function child(a, i, j, k) {
    12         var last = 2.71828;
    13         for (var l = 0; l < 9; l++)
    14             if (i == 8 && j == 8 && k == 8)
    15                 last = a[l].pop();  // reenters interpreter in getter
    16         return last;
    17     }
    18     function parent(a, i, j) {
    19         var last;
    20         for (var k = 0; k < 9; k++)
    21             last = child(a, i, j, k);
    22         return last;
    23     }
    24     function gramps(a, i) { 
    25         var last;
    26         for (var j = 0; j < 9; j++)
    27             last = parent(a, i, j);
    28         return last;
    29     }
    31     var last;
    32     for (var i = 0; i < 9; i++)
    33         last = gramps(a, i);
    34     return last;
    35 }
    36 assertEq(testSlowArrayPopNestedTrees(), 3.14159);

mercurial