]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/varargs-then-slow-call.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / varargs-then-slow-call.js
CommitLineData
ed1e77d3
A
1function foo(a, b) {
2 return a + b;
3}
4noInline(foo);
5
6function bar() {
7 return foo.apply(this, arguments);
8}
9
10function fuzz(a, b, c, d, e, f) {
11 return a + b + c + d + e + f;
12}
13noInline(fuzz);
14
15function baz(array) {
16 var a = array[0];
17 var b = array[1];
18 var c = array[2];
19 var d = array[3];
20 var e = array[4];
21 var f = array[5];
22 var g = array[6];
23 var h = array[7];
24 var i = array[8];
25 var j = array[9];
26
27 var x = bar(a, b);
28 var y = fuzz(a, b, c, d, e, f);
29
30 return a + b + c + d + e + f + g + h + i + j + x + y;
31}
32
33noInline(baz);
34
35for (var i = 0; i < 10000; ++i) {
36 var result = baz([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
37 if (result != 61)
38 throw "Error: bad result: " + result;
39}
40