]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/simple-polyvariant-call-inlining-example.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / simple-polyvariant-call-inlining-example.js
CommitLineData
81345200
A
1function foo(baz) {
2 return bar(baz);
3}
4
5function fuzz(baz) {
6 return bar(baz);
7}
8
9function bar(baz) {
10 return baz();
11}
12
13function baz1() {
14 return 42;
15}
16
17function baz2() {
18 return 24;
19}
20
21noInline(foo);
22noInline(fuzz);
23
24for (var i = 0; i < 100000; ++i) {
25 var result = foo(baz1);
26 if (result != 42)
27 throw "Error: bad result: " + result;
28 var result = fuzz(baz2);
29 if (result != 24)
30 throw "Error: bad result: " + result;
31}
32