]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/simple-polyvariant-get-by-id-inlining-example.js
JavaScriptCore-7600.1.4.16.1.tar.gz
[apple/javascriptcore.git] / tests / stress / simple-polyvariant-get-by-id-inlining-example.js
CommitLineData
81345200
A
1function foo(o) {
2 return bar(o);
3}
4
5function fuzz(o) {
6 return bar(o);
7}
8
9function bar(o) {
10 return o.f;
11}
12
13noInline(foo);
14noInline(fuzz);
15
16for (var i = 0; i < 100000; ++i) {
17 var result = foo({f:42});
18 if (result != 42)
19 throw "Error: bad result: " + result;
20 var result = fuzz({g:23, f:24});
21 if (result != 24)
22 throw "Error: bad result: " + result;
23}
24