]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/activation-sink-osrexit-default-value.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / activation-sink-osrexit-default-value.js
CommitLineData
ed1e77d3
A
1var n = 10000000;
2
3function bar(set) {
4 var result = set(0);
5 if (result !== void 0)
6 throw "Error: bad value: " + result;
7}
8
9function foo(b) {
10 var result = 0;
11 var imUndefined;
12 var baz;
13 var set = function (x) {
14 result = x;
15 if (baz !== 50)
16 throw "Error: bad value: " + baz;
17 return imUndefined;
18 }
19 baz = 50;
20 if (b) {
21 OSRExit();
22 if (b) {
23 bar(set);
24 }
25 return 0;
26 }
27 return result;
28}
29
30noInline(bar);
31noInline(foo);
32
33for (var i = 0; i < n; i++) {
34 var result = foo(!(i % 100));
35 if (result != 0)
36 throw "Error: bad result: " + result;
37}