js/src/jit-test/tests/parallel/bug909743.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 if (getBuildConfiguration().parallelJS) {
     2   function assertParallelExecSucceeds(opFunction) {
     3     for (var i = 0; i < 100; ++i) {
     4       opFunction({mode:"compile"});
     5     }
     6   }
     7   function assertArraySeqParResultsEq(arr, op, func) {
     8     assertParallelExecSucceeds(
     9       function (m) { 
    10         return arr[op + "Par"].apply(arr, [func, m]); 
    11       }
    12     );
    13   }
    14   function range(n, m) {
    15     var result = [];
    16     for (var i = n; i < m; i++)
    17       result.push(i);
    18     return result;
    19   }
    20   assertArraySeqParResultsEq(range(0, 512), "map", function(e) { return e+'x'; });
    21 }

mercurial