(f, iterations)
| 30 | // Flags: --no-stress-flush-code --no-lazy-feedback-allocation |
| 31 | |
| 32 | function test(f, iterations) { |
| 33 | %PrepareFunctionForOptimization(f); |
| 34 | f(); |
| 35 | f(); |
| 36 | // Some of the tests need to learn until they stabilize. |
| 37 | let n = iterations ? iterations : 1; |
| 38 | for (let i = 0; i < n; i++) { |
| 39 | %OptimizeFunctionOnNextCall(f); |
| 40 | f(); |
| 41 | %PrepareFunctionForOptimization(f); |
| 42 | } |
| 43 | // Assert that the function finally stabilized. |
| 44 | assertOptimized(f); |
| 45 | } |
| 46 | |
| 47 | test(function add() { |
| 48 | assertEquals(2, 1 + 1); |
no test coverage detected