js/src/jit-test/tests/ion/getPropertyCacheOverflow.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 // This test was made to be effective with --no-jm.
michael@0 2
michael@0 3 var list = [
michael@0 4 { entry00: 0, length: 1 },
michael@0 5 { entry01: 0, length: 1 },
michael@0 6 { entry02: 0, length: 1 },
michael@0 7 { entry03: 0, length: 1 },
michael@0 8 { entry04: 0, length: 1 },
michael@0 9 { entry05: 0, length: 1 },
michael@0 10 { entry06: 0, length: 1 },
michael@0 11 { entry07: 0, length: 1 },
michael@0 12 { entry08: 0, length: 1 },
michael@0 13 { entry09: 0, length: 1 },
michael@0 14 { entry10: 0, length: 1 },
michael@0 15 { entry11: 0, length: 1 },
michael@0 16 { entry12: 0, length: 1 },
michael@0 17 { entry13: 0, length: 1 },
michael@0 18 { entry14: 0, length: 1 },
michael@0 19 { entry15: 0, length: 1 },
michael@0 20 { entry16: 0, length: 1 }, // cause an overflow.
michael@0 21 { entry17: 0, length: 1 },
michael@0 22 [0],
michael@0 23 (new Uint8Array(new ArrayBuffer(1)))
michael@0 24 ];
michael@0 25
michael@0 26 function f(obj) {
michael@0 27 return obj.length;
michael@0 28 }
michael@0 29
michael@0 30 // Cook the f function on the top of the list to make sure we do not register
michael@0 31 // our test cases.
michael@0 32 for (var i = 0; i < 100; i++)
michael@0 33 f(list[i % 10]);
michael@0 34
michael@0 35 // Register & check stubs.
michael@0 36 for (var i = 0; i < 40; i++)
michael@0 37 assertEq(f(list[i % 20]), 1);

mercurial