8 #ifndef V8_BASE_SAFE_CONVERSIONS_IMPL_H_
9 #define V8_BASE_SAFE_CONVERSIONS_IMPL_H_
23 template <
typename NumericType>
25 static const int value = std::numeric_limits<NumericType>::is_iec559
26 ? std::numeric_limits<NumericType>::max_exponent
27 : (
sizeof(NumericType) * 8 + 1 -
28 std::numeric_limits<NumericType>::is_signed);
56 std::numeric_limits<Src>::is_signed
63 template <
typename Dst,
typename Src, IntegerRepresentation Sign>
73 template <
typename Dst,
typename Src>
85 template <
typename Dst,
typename Src>
111 bool is_in_lower_bound) {
126 StaticDstRangeRelationToSrcRange<Dst, Src>::value >
134 template <
typename Dst,
148 template <
typename Dst,
typename Src>
155 return std::numeric_limits<Dst>::is_iec559
157 value >= -std::numeric_limits<Dst>::max())
164 template <
typename Dst,
typename Src>
176 template <
typename Dst,
typename Src>
183 return sizeof(Dst) >
sizeof(Src)
186 value <=
static_cast<Src
>(std::numeric_limits<Dst>::max()),
193 template <
typename Dst,
typename Src>
203 value <=
static_cast<Src
>(std::numeric_limits<Dst>::max()),
204 value >=
static_cast<Src
>(0));
208 template <
typename Dst,
typename Src>
#define DCHECK(condition)
#define STATIC_ASSERT(test)
RangeConstraint GetRangeConstraint(int integer_range_constraint)
@ INTEGER_REPRESENTATION_SIGNED
@ INTEGER_REPRESENTATION_UNSIGNED
RangeConstraint DstRangeRelationToSrcRange(Src value)
NumericRangeRepresentation
@ NUMERIC_RANGE_NOT_CONTAINED
@ NUMERIC_RANGE_CONTAINED
static int min(int a, int b)
Debugger support for the V8 JavaScript engine.
static RangeConstraint Check(Src value)
static RangeConstraint Check(Src value)
static RangeConstraint Check(Src value)
static RangeConstraint Check(Src value)
static RangeConstraint Check(Src value)