michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 203278; michael@0: var summary = 'Don\'t crash in recursive js_MarkGCThing'; michael@0: var actual = 'FAIL'; michael@0: var expect = 'PASS'; michael@0: michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: // Prepare array a to cause O(a.length^2) behaviour in the current michael@0: // DeutschSchorrWaite implementation michael@0: michael@0: var a = new Array(1000 * 100); michael@0: michael@0: var i = a.length; michael@0: while (i-- != 0) michael@0: { michael@0: a[i] = {}; michael@0: } michael@0: michael@0: // Prepare linked list that causes recursion during GC with michael@0: // depth O(list size) michael@0: michael@0: for (i = 0; i != 50*1000; ++i) michael@0: { michael@0: a = [a, a.concat()]; michael@0: } michael@0: michael@0: if (typeof gc == 'function') michael@0: { michael@0: gc(); michael@0: } michael@0: michael@0: actual = 'PASS'; michael@0: michael@0: reportCompare(expect, actual, summary); michael@0: