]> git.saurik.com Git - apple/javascriptcore.git/blame - 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
CommitLineData
ed1e77d3
A
1function foo(a, b, c) {
2 return 42;
3}
4
5function bar(a, b, c) {
6 return a + b + c;
7}
8
9function baz(f, o) {
10 return f(o[0], o[1], o[2]);
11}
12
13noInline(baz);
14
15var o = new Float32Array(3);
16o[0] = 1;
17o[1] = 2;
18o[2] = 3;
19for (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
25var result = baz(bar, o);
26if (result != 6)
27 throw "Error: bad result in loop: " + result;