blob: 9b368e85761b4b22e86828c4ca0a64922929a8c3 [file] [log] [blame]
function foo(p, o) {
var result = 0;
for (var i = 0; i < 1000; ++i) {
if (p)
result += o.f;
else
result++;
}
return result;
}
noInline(foo);
var o = {f:42};
var p = {};
var result = 0;
for (var i = 0; i < 1000; ++i) {
result += foo(true, o);
result += foo(false, p);
}
for (var i = 0; i < 10000; ++i)
result += foo(false, p);
for (var i = 0; i < 30000; ++i)
result += foo(true, o);
if (result != 1313000000)
throw "Error: bad result: " + result;