]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/inline-call-that-doesnt-use-all-args.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / inline-call-that-doesnt-use-all-args.js
1 function foo(a, b, c) {
2 return 42;
3 }
4
5 function bar(a, b, c) {
6 return a + b + c;
7 }
8
9 function baz(f, o) {
10 return f(o[0], o[1], o[2]);
11 }
12
13 noInline(baz);
14
15 var o = new Float32Array(3);
16 o[0] = 1;
17 o[1] = 2;
18 o[2] = 3;
19 for (var i = 0; i < 10000; ++i) {
20 var result = baz(foo, o);
21 if (result != 42)
22 throw "Error: bad result in loop: " + result;
23 }
24
25 var result = baz(bar, o);
26 if (result != 6)
27 throw "Error: bad result in loop: " + result;