blob: 619461dc81ba42f4ef69e6788e0c478dd4110ac6 [file] [log] [blame]
sbarati@apple.coma79472d2018-01-11 23:21:18 +00001function test(b, f) {
2 if (b)
3 return f(b);
4}
5noInline(test);
6
7function throwError(b) {
8 if (b) {
9 try {
10 throw new Error;
11 } catch(e) { }
12 }
13 return 2;
14}
15noInline(throwError);
16
17function makeFoo() {
18 return function foo(b) {
19 throwError(b);
20 OSRExit();
21 }
22}
23
24let foos = [makeFoo(), makeFoo()];
25for (let i = 0; i < 10000; ++i) {
26 test(!!(i%2), foos[((Math.random() * 100) | 0) % foos.length]);
27}