5 #ifndef V8_CONVERSIONS_H_
6 #define V8_CONVERSIONS_H_
31 return (x >=
'0' && x <=
'9' && x <
'0' + radix)
32 || (radix > 10 && x >=
'a' && x <
'a' + radix - 10)
33 || (radix > 10 && x >=
'A' && x <
'A' + radix - 10);
38 return x ==
'0' || x ==
'1';
47 if (!(x >= INT_MIN))
return INT_MIN;
48 if (x > INT_MAX)
return INT_MAX;
49 return static_cast<int>(x);
61 inline unsigned int FastD2UI(
double x);
68 return static_cast<double>(x);
76 return static_cast<double>(x);
112 Vector<const uint8_t> str,
114 double empty_string_val = 0);
116 Vector<const uc16> str,
118 double empty_string_val = 0);
123 double empty_string_val = 0);
127 Vector<const uint8_t> vector,
132 Vector<const uc16> vector,
190 if (number->IsSmi())
return Smi::cast(number)->value();
196 if (number->IsSmi())
return Smi::cast(number)->value();
204 double empty_string_val = 0.0);
208 Object* number,
size_t* result) {
209 SealHandleScope shs(isolate);
210 if (number->IsSmi()) {
211 int value = Smi::cast(number)->value();
213 <= std::numeric_limits<size_t>::max());
215 *result =
static_cast<size_t>(value);
220 DCHECK(number->IsHeapNumber());
221 double value = HeapNumber::cast(number)->value();
223 value <= std::numeric_limits<size_t>::max()) {
224 *result =
static_cast<size_t>(value);
A JavaScript string value (ECMA-262, 4.3.17).
static const int kMaxValue
static const int kMinValue
#define DCHECK(condition)
uint32_t DoubleToUint32(double x)
bool isDigit(int x, int radix)
char * DoubleToRadixCString(double value, int radix)
static bool IsUint32Double(double value)
char * DoubleToFixedCString(double value, int f)
static bool IsInt32Double(double value)
unsigned int FastD2UI(double x)
double DoubleToInteger(double x)
char * DoubleToExponentialCString(double value, int f)
char * DoubleToPrecisionCString(double value, int p)
double StringToInt(UnicodeCache *unicode_cache, Vector< const uint8_t > vector, int radix)
const int kDoubleToCStringMinBufferSize
int32_t NumberToInt32(Object *number)
const int kMaxSignificantDigits
int32_t DoubleToInt32(double x)
uint32_t NumberToUint32(Object *number)
float DoubleToFloat32(double x)
size_t NumberToSize(Isolate *isolate, Object *number)
const char * DoubleToCString(double v, Vector< char > buffer)
double FastUI2D(unsigned x)
static bool IsMinusZero(double value)
const uint32_t kMaxUInt32
bool TryNumberToSize(Isolate *isolate, Object *number, size_t *result)
const char * IntToCString(int n, Vector< char > buffer)
double StringToDouble(UnicodeCache *unicode_cache, const char *str, int flags, double empty_string_val)
int FastD2IChecked(double x)
static bool IsSmiDouble(double value)
bool isBinaryDigit(int x)
Debugger support for the V8 JavaScript engine.