blob: 5503025a101ee61cc8ec359a7bfb3fb634e41d7a [file] [log] [blame]
//@ if $jitTests then defaultNoEagerRun(*NO_CJIT_OPTIONS) else skip end
function foo(a, inBounds) {
a[0] = 1;
if (!inBounds) {
a[1] = 2;
a[2] = 3;
}
}
noInline(foo);
var array = new Int8Array(1);
for (var i = 0; i < 100000; ++i)
foo(array, true);
if (reoptimizationRetryCount(foo))
throw "Error: unexpected retry count: " + reoptimizationRetryCount(foo);
for (var i = 0; i < 100000; ++i)
foo(array, false);
if (reoptimizationRetryCount(foo) != 1)
throw "Error: unexpected retry count: " + reoptimizationRetryCount(foo);