Debian Codegraph @

rhino/testsrc/tests/js1_5/GC/regress-203278-3.js

raw symbols SCIP
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/. */
5
6 var gTestfile = 'regress-203278-3.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 203278;
9 var summary = 'Don\'t crash in recursive js_MarkGCThing';
10 var actual = 'FAIL';
11 var expect = 'PASS';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 // Prepare array a to cause O(a.length^2) bahaviour in the current
17 // DeutschSchorrWaite implementation
18
19 var a = new Array(1000 * 100);
20
21 var i = a.length;
22 while (i-- != 0)
23 {
24 a[i] = {};
25 }
26
27 // Prepare linked list that causes recursion during GC with
28 // depth O(list size)
29
30 for (i = 0; i != 50*1000; ++i)
31 {
32 a = [a, a.concat()];
33 }
34
35 if (typeof gc == 'function')
36 {
37 gc();
38 }
39
40 actual = 'PASS';
41
42 reportCompare(expect, actual, summary);
43