michael@0: // This test was made to be effective with --no-jm. michael@0: michael@0: var list = [ michael@0: { entry00: 0, length: 1 }, michael@0: { entry01: 0, length: 1 }, michael@0: { entry02: 0, length: 1 }, michael@0: { entry03: 0, length: 1 }, michael@0: { entry04: 0, length: 1 }, michael@0: { entry05: 0, length: 1 }, michael@0: { entry06: 0, length: 1 }, michael@0: { entry07: 0, length: 1 }, michael@0: { entry08: 0, length: 1 }, michael@0: { entry09: 0, length: 1 }, michael@0: { entry10: 0, length: 1 }, michael@0: { entry11: 0, length: 1 }, michael@0: { entry12: 0, length: 1 }, michael@0: { entry13: 0, length: 1 }, michael@0: { entry14: 0, length: 1 }, michael@0: { entry15: 0, length: 1 }, michael@0: { entry16: 0, length: 1 }, // cause an overflow. michael@0: { entry17: 0, length: 1 }, michael@0: [0], michael@0: (new Uint8Array(new ArrayBuffer(1))) michael@0: ]; michael@0: michael@0: function f(obj) { michael@0: return obj.length; michael@0: } michael@0: michael@0: // Cook the f function on the top of the list to make sure we do not register michael@0: // our test cases. michael@0: for (var i = 0; i < 100; i++) michael@0: f(list[i % 10]); michael@0: michael@0: // Register & check stubs. michael@0: for (var i = 0; i < 40; i++) michael@0: assertEq(f(list[i % 20]), 1);