js/src/jit-test/tests/basic/testChangingObjectWithLength.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 testChangingObjectWithLength()
     2 {
     3   var obj = { length: 10 };
     4   var dense = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
     5   var slow = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; slow.slow = 5;
     7   /*
     8    * The elements of objs constitute a De Bruijn sequence repeated 4x to trace
     9    * and run native code for every object and transition.
    10    */
    11   var objs = [obj, obj, obj, obj,
    12               obj, obj, obj, obj,
    13               dense, dense, dense, dense,
    14               obj, obj, obj, obj,
    15               slow, slow, slow, slow,
    16               dense, dense, dense, dense,
    17               dense, dense, dense, dense,
    18               slow, slow, slow, slow,
    19               slow, slow, slow, slow,
    20               obj, obj, obj, obj];
    22   var counter = 0;
    24   for (var i = 0, sz = objs.length; i < sz; i++)
    25   {
    26     var o = objs[i];
    27     for (var j = 0; j < o.length; j++)
    28       counter++;
    29   }
    31   return counter;
    32 }
    33 assertEq(testChangingObjectWithLength(), 400);

mercurial