Comment #6 on issue 2306 by [email protected]: Unexpected bounds-check
bailout accesing Int8Array
http://code.google.com/p/v8/issues/detail?id=2306
@Paul: Thanks for the hydrogen! From what I see in the hydrogen your lhu
function does not actually have +0 in it. This is what confused me
initially and lead to such a wierd repro. I would think that if you add +0
in your code then deopt should also go away.
Cleaner repro for your case:
function lhu(ram, a) { return ram[a]; }
var arr = new Int8Array(10);
function HeapNumber(x, y) { return x - y; }
HeapNumber(2.2, 0.2); // force IC into heap numbers case.
var number8 = HeapNumber(8.8, 0.8); // this should be equal to precisely 8.
lhu(arr, 0);
%OptimizeFunctionOnNextCall(lhu);
lhu(arr, number8);
%OptimizeFunctionOnNextCall(lhu);
lhu(arr, number8);
%OptimizeFunctionOnNextCall(lhu);
lhu(arr, number8);
It should be noted that x|0 is not always a Smi unless you know that x is
in Smi range - then result I think should always be a Smi.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev