Comment #4 on issue 1434 by [email protected]: Crankshafted === specialized for doubles doesn't handle undefined correctly
http://code.google.com/p/v8/issues/detail?id=1434

I don't see a better way than to create a flag on NumberUntagD, saying that it should deopt on undefined rather than convert to NaN. Then, at Hydrogen analysis time, we need a property on uses of an HValue that says whether a double use wants undefined converted to NaN or not. This is exactly the issue that bit us on count operations as well.

Other possible solutions are to pass both the original and untagged HValues to compare, but that seems terrible. We could also add explicit HCheck instructions looking for undefined, but that seems incompatible with the way in which we decide type information (an HCheck that accepts double or tagged input, outputs double, and does nothing if the input is double - but that is almost just the same semantics as NumberUntagD with the flag set to deopt on undefined). It is annoying to add a virtual function to all HValues, just so we can check whether a context wanting a double wants undefined converted or not, but it looks like the best alternative.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to