OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CONVERSIONS_H_ | 5 #ifndef V8_CONVERSIONS_H_ |
6 #define V8_CONVERSIONS_H_ | 6 #define V8_CONVERSIONS_H_ |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
11 #include "src/handles.h" | |
12 #include "src/utils.h" | 11 #include "src/utils.h" |
13 | 12 |
14 namespace v8 { | 13 namespace v8 { |
15 namespace internal { | 14 namespace internal { |
16 | 15 |
| 16 template <typename T> |
| 17 class Handle; |
17 class UnicodeCache; | 18 class UnicodeCache; |
18 | 19 |
19 // Maximum number of significant digits in decimal representation. | 20 // Maximum number of significant digits in decimal representation. |
20 // The longest possible double in decimal representation is | 21 // The longest possible double in decimal representation is |
21 // (2^53 - 1) * 2 ^ -1074 that is (2 ^ 53 - 1) * 5 ^ 1074 / 10 ^ 1074 | 22 // (2^53 - 1) * 2 ^ -1074 that is (2 ^ 53 - 1) * 5 ^ 1074 / 10 ^ 1074 |
22 // (768 digits). If we parse a number whose first digits are equal to a | 23 // (768 digits). If we parse a number whose first digits are equal to a |
23 // mean of 2 adjacent doubles (that could have up to 769 digits) the result | 24 // mean of 2 adjacent doubles (that could have up to 769 digits) the result |
24 // must be rounded to the bigger one unless the tail consists of zeros, so | 25 // must be rounded to the bigger one unless the tail consists of zeros, so |
25 // we don't need to preserve all the digits. | 26 // we don't need to preserve all the digits. |
26 const int kMaxSignificantDigits = 772; | 27 const int kMaxSignificantDigits = 772; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // Converts a number into size_t. | 189 // Converts a number into size_t. |
189 inline size_t NumberToSize(Object* number); | 190 inline size_t NumberToSize(Object* number); |
190 | 191 |
191 // returns DoubleToString(StringToDouble(string)) == string | 192 // returns DoubleToString(StringToDouble(string)) == string |
192 bool IsSpecialIndex(UnicodeCache* unicode_cache, String* string); | 193 bool IsSpecialIndex(UnicodeCache* unicode_cache, String* string); |
193 | 194 |
194 } // namespace internal | 195 } // namespace internal |
195 } // namespace v8 | 196 } // namespace v8 |
196 | 197 |
197 #endif // V8_CONVERSIONS_H_ | 198 #endif // V8_CONVERSIONS_H_ |
OLD | NEW |