]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/fold-profiled-call-to-call.js
387a88c4a26699c7ff1e62f36c8abbf1b6058395
[apple/javascriptcore.git] / tests / stress / fold-profiled-call-to-call.js
1 function foo(f) {
2 if (DFGTrue())
3 f = bar;
4 return f().f;
5 }
6
7 noInline(foo);
8
9 var object;
10 function bar() {
11 return object;
12 }
13
14 function baz() { return {f:42}; };
15
16 object = {f:42};
17 for (var i = 0; i < 1000; ++i)
18 foo((i & 1) ? bar : baz);
19
20 object = {e:1, f:2};
21 var result = foo(bar);
22 if (result != 2)
23 throw "Error: bad result: " + result;
24