js/src/jit-test/tests/ion/bug858586.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 function A(a) { this.a = a; }
michael@0 2 A.prototype.foo = function (x) {};
michael@0 3 function B(b) { this.b = b; }
michael@0 4 B.prototype.foo = function (x) {};
michael@0 5 function C(c) {}
michael@0 6 function makeArray(n) {
michael@0 7 var classes = [A, B, C];
michael@0 8 var arr = [];
michael@0 9 for (var i = 0; i < n; i++) {
michael@0 10 arr.push(new classes[i % 3](i % 3));
michael@0 11 }
michael@0 12 return arr;
michael@0 13 }
michael@0 14 function runner(arr, resultArray, len) {
michael@0 15 for (var i = 0; i < len; i++) {
michael@0 16 var obj = arr[i];
michael@0 17 resultArray[0] += obj.foo(i);
michael@0 18 }
michael@0 19 }
michael@0 20 var resultArray = [0];
michael@0 21 var arr = makeArray(30000);
michael@0 22 C.prototype.foo = Uint8ClampedArray;
michael@0 23 runner(arr, resultArray, 30000);

mercurial