]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/dfg-create-arguments-inline-alloc.js
JavaScriptCore-7600.1.4.16.1.tar.gz
[apple/javascriptcore.git] / tests / stress / dfg-create-arguments-inline-alloc.js
1 var foo = function(o) {
2 var a = Array.prototype.slice.call(arguments);
3 var sum = 0;
4 for (var i = 0; i < a.length; ++i)
5 sum += a[i].x;
6 return sum;
7 };
8
9 noInline(foo);
10
11 var niters = 10000;
12 var total = 0;
13 var o = {x: 42};
14 for (var i = 0; i < niters; ++i) {
15 total += foo(o, o, o);
16 }
17
18 if (total != 42 * 3 * niters)
19 throw new Error("Incorrect result!");