blob: d4340e7d04b9c8c06b51501ba069419bb61bab9c [file] [log] [blame]
"use strict";
function ThingA() {
}
ThingA.prototype = {bug: 42};
function ThingB() {
}
ThingB.prototype = {bug: 43};
function ThingC() {
}
ThingC.prototype = {bug: 44};
function bar(o, p) {
if (p)
return o.bug;
return null;
}
function foo(p) {
var o = new ThingC();
return bar(o, p);
}
noInline(foo);
for (var i = 0; i < 10000; ++i) {
bar(new ThingA(), true);
bar(new ThingB(), true);
}
for (var i = 0; i < 10000; ++i)
foo(false);
var result = foo(true);
if (result != 44)
throw new Error("Bad result: " + result);