LGTM, although I think that in the long run the checks should be pushed to
the
callers in an appropriate way: Some call sites don't need the check, at
others a
priori checks would be more suitable than posteriori ones.
Note that we still operate outside the C++ spec, because we rely on IEEE 754
semantics, so this can break any time again when compilers try to reclaim
sane
mathematical semantics from the IEEE mess at higher optimization levels (see
e.g. MSVC 2012).
http://codereview.chromium.org/10820047/diff/1/src/conversions.h
File src/conversions.h (right):
http://codereview.chromium.org/10820047/diff/1/src/conversions.h#newcode62
src/conversions.h:62: // The result is unspecified if x is infinite or
NaN, or if the rounded
The comment should be synced with the code below.
http://codereview.chromium.org/10820047/diff/1/src/conversions.h#newcode65
src/conversions.h:65: // The static_cast convertion from double to int
used to be slow, but
I think this comment can be removed, it is totally misleading.
http://codereview.chromium.org/10820047/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev