js/src/tests/js1_5/GC/regress-203278-2.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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 //-----------------------------------------------------------------------------
     7 var BUGNUMBER = 203278;
     8 var summary = 'Don\'t crash in recursive js_MarkGCThing';
     9 var actual = 'FAIL';
    10 var expect = 'PASS';
    12 printBugNumber(BUGNUMBER);
    13 printStatus (summary);
    15 // Prepare  array to test DeutschSchorrWaite implementation
    16 // and its reverse pointer scanning performance
    18 var a = new Array(1000 * 1000);
    20 var i = a.length;
    21 while (i-- != 0) {
    22   switch (i % 11) {
    23   case 0:
    24     a[i] = { };
    25     break;
    26   case 1:
    27     a[i] = { a: true, b: false, c: 0 };
    28     break;
    29   case 2:
    30     a[i] = { 0: true, 1: {}, 2: false };
    31     break;
    32   case 3:
    33     a[i] = { a: 1.2, b: "", c: [] };
    34     break;
    35   case 4:
    36     a[i] = [ false ];
    37     break;
    38   case 6:
    39     a[i] = [];
    40     break;
    41   case 7:
    42     a[i] = false;
    43     break;
    44   case 8:
    45     a[i] = "x";
    46     break;
    47   case 9:
    48     a[i] = new String("x");
    49     break;
    50   case 10:
    51     a[i] = 1.1;
    52     break;
    53   case 10:
    54     a[i] = new Boolean();
    55     break;
    56   }	   
    57 }
    59 printStatus("DSF is prepared");
    61 // Prepare linked list that causes recursion during GC with
    62 // depth O(list size)
    63 // Note: pass "-S 500000" option to the shell to limit stack quota
    64 // available for recursion
    66 for (i = 0; i != 50*1000; ++i) {
    67   a = [a, a, {}];
    68   a = [a,  {}, a];
    70 }
    72 printStatus("Linked list is prepared");
    74 gc();
    76 actual = 'PASS';
    78 reportCompare(expect, actual, summary);

mercurial