(test_func, array, expected_result)
| 296 | const kRuns = 10; |
| 297 | |
| 298 | function run_test(test_func, array, expected_result) { |
| 299 | %PrepareFunctionForOptimization(test_func); |
| 300 | for (var i = 0; i < 5; i++) test_func(array, 0); |
| 301 | %OptimizeFunctionOnNextCall(test_func); |
| 302 | var sum = 0; |
| 303 | for (var i = 0; i < kRuns; i++) { |
| 304 | sum = test_func(array, sum); |
| 305 | } |
| 306 | assertEquals(expected_result, sum); |
| 307 | %DeoptimizeFunction(test_func); |
| 308 | %ClearFunctionFeedback(test_func); |
| 309 | } |
| 310 | |
| 311 | function run_bounds_test(test_func, array, expected_result) { |
| 312 | assertEquals(undefined, a[kElementCount]); |
no test coverage detected