]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/activation-sink.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / activation-sink.js
CommitLineData
ed1e77d3
A
1var n = 10000000;
2
3function bar(f) { f(10); }
4
5function foo(b) {
6 var result = 0;
7 var set = function (x) { result = x; }
8 if (b) {
9 bar(set);
10 if (result != 10)
11 throw "Error: bad: " + result;
12 return 0;
13 }
14 return result;
15}
16
17noInline(bar);
18noInline(foo);
19
20for (var i = 0; i < n; i++) {
21 var result = foo(!(i % 100));
22 if (result != 0)
23 throw "Error: bad result: " + result;
24}