blob: 5f8746e56f9e70a18c9557d3da4a3810d367fd1f [file] [log] [blame]
function foo(arr, index) {
arr[index] = index;
for (let j = 0; j < 1e2; j++) {
let x = {};
x.x = arr;
}
}
noInline(foo);
const arr = new Array(10).fill({});
let result = 0;
for (let i = 0; i < 1e6; i++) {
result += foo(arr, i % arr.length);
}
for (let i = 0; i < 1e6; i++) {
result += foo(arr, i % arr.length);
if (!(i % arr.length))
result += foo(arr, -1);
}