]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function sink (p, q) { |
2 | var g = function(x) { return x; }; | |
3 | if (p) { if (q) OSRExit(); return g; } | |
4 | return function(x) { return x; }; | |
5 | } | |
6 | noInline(sink); | |
7 | ||
8 | for (var i = 0; i < 10000; ++i) { | |
9 | var f = sink(true, false); | |
10 | var result = f(42); | |
11 | if (result != 42) | |
12 | throw "Error: expected 42 but got " + result; | |
13 | } | |
14 | ||
15 | // At this point, the function should be compiled down to the FTL | |
16 | ||
17 | // Check that the function is properly allocated on OSR exit | |
18 | var f = sink(true, true); | |
19 | var result = f(42); | |
20 | if (result != 42) | |
21 | throw "Error: expected 42 but got " + result; |