]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | //@ defaultNoEagerRun |
2 | ||
3 | function foo(o) { | |
4 | return o.f; | |
5 | } | |
6 | ||
7 | for (var i = 0; i < 100; ++i) { | |
8 | var result = foo((i & 1) ? {f:1, g:2} : {g:1, f:2}); | |
9 | if (result != 2 - (i & 1)) | |
10 | throw "Error: bad result in warm-up loop for i = " + i + ": " + result; | |
11 | } | |
12 | ||
13 | function bar(o) { | |
14 | return o.g + foo(o); | |
15 | } | |
16 | ||
17 | noInline(bar); | |
18 | ||
19 | for (var i = 0; i < 100000; ++i) { | |
20 | var result = bar({f:i, g:i * 3}); | |
21 | if (result != i * 4) | |
22 | throw "Error: bad result for i = " + i + ": " + result; | |
23 | } | |
24 | ||
25 | if (reoptimizationRetryCount(bar)) | |
26 | throw "Error: reoptimized bar unexpectedly: " + reoptimizationRetryCount(bar); |