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.

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

mercurial