blob: afbb790bb50392f579ce1d4ea45d05fa5c21a82c [file] [log] [blame]
function foo(a, b, c) {
return 42;
}
function bar(a, b, c) {
return a + b + c;
}
function baz(f, o) {
return f(o[0], o[1], o[2]);
}
noInline(baz);
var o = new Float32Array(3);
o[0] = 1;
o[1] = 2;
o[2] = 3;
for (var i = 0; i < 10000; ++i) {
var result = baz(foo, o);
if (result != 42)
throw "Error: bad result in loop: " + result;
}
var result = baz(bar, o);
if (result != 6)
throw "Error: bad result in loop: " + result;