DBC

https://codereview.chromium.org/105313008/diff/1/src/type-info.h
File src/type-info.h (right):

https://codereview.chromium.org/105313008/diff/1/src/type-info.h#newcode45
src/type-info.h:45: static inline bool IsInt32Double(double value) {
On 2013/12/16 09:21:13, rossberg wrote:
We might consider moving this elsewhere, since it isn't really about
"type
info". Maybe v8conversions.h?

... and perhaps refactor it to:

----------------------------------------
inline bool IsMinusZero(double value) {
  return DoubleRepresentation(value).bits ==
DoubleRepresentation(-0.0).bits;
}

static inline bool IsInt32Double(double value) {
  return !IsMinusZero(value) &&
      kMinInt <= value && value <= kMaxInt &&
      value == static_cast<int32_t>(value);
}
----------------------------------------

For added bonus points, use IsMinusZero at half a dozen similar places,
add operator=() to DoubleRepresentation, use IsInt32Double at several
places, perhaps add an IsInRange predicate. :-)

https://codereview.chromium.org/105313008/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to