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