js/src/jit-test/tests/parallel/binary-arith-numbers.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 load(libdir + "parallelarray-helpers.js");
     3 // Test that we are able to add numbers even if the typesets are not
     4 // "clean" because we have previously added strings and numbers.  This
     5 // should cause fallible unboxing to occur.
     7 function theTest() {
     8   var mixedArray = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.1,
     9                     "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
    11   function op(e, i) {
    12     return mixedArray[e % mixedArray.length] + i;
    13   }
    15   // run op once where it has to add doubles and strings,
    16   // just to pullute the typesets:
    17   var jsarray0 = range(0, 1024);
    18   jsarray0.map(op);
    20   // this version will never actually touch the strings:
    21   assertArraySeqParResultsEq(range(0, 1024), "map", function (i) { return i % 10; });
    23   // but if we try against the original we get bailouts:
    24   assertParallelExecWillBail(function (mode) {
    25     jsarray0.mapPar(op, mode);
    26   });
    27 }
    29 if (getBuildConfiguration().parallelJS)
    30   theTest();

mercurial