blob: 6c226d527f379194ebffe4cc00007e843a13112a [file] [log] [blame]
function foo(o, start) {
var result = 0;
for (var i = 0; i < 100; ++i)
result += o.f;
return result;
}
noInline(foo);
var o = {};
o.f = 42;
var f = {};
f.f = 43;
f.g = 44;
for (var i = 0; i < 10000; ++i)
o.f = i;
o.f = 42;
for (var i = 0; i < 10000; ++i) {
var p;
if (i & 1)
p = o;
else
p = Object.create(o);
var result = foo(p);
if (result != 100 * 42)
throw "Error: bad result: " + result;
}
var q = {};
q.f = 43;
var result = foo(q);
if (result != 100 * 43)
throw "Error: bad result at end: " + result;