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" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 // Additional number to string conversions for the number type. | 143 // Additional number to string conversions for the number type. |
144 // The caller is responsible for calling free on the returned pointer. | 144 // The caller is responsible for calling free on the returned pointer. |
145 char* DoubleToFixedCString(double value, int f); | 145 char* DoubleToFixedCString(double value, int f); |
146 char* DoubleToExponentialCString(double value, int f); | 146 char* DoubleToExponentialCString(double value, int f); |
147 char* DoubleToPrecisionCString(double value, int f); | 147 char* DoubleToPrecisionCString(double value, int f); |
148 char* DoubleToRadixCString(double value, int radix); | 148 char* DoubleToRadixCString(double value, int radix); |
149 | 149 |
150 | 150 |
151 static inline bool IsMinusZero(double value) { | 151 static inline bool IsMinusZero(double value) { |
152 static const DoubleRepresentation minus_zero(-0.0); | 152 return bit_cast<int64_t>(value) == bit_cast<int64_t>(-0.0); |
153 return DoubleRepresentation(value) == minus_zero; | |
154 } | 153 } |
155 | 154 |
156 | 155 |
157 inline bool IsSmiDouble(double value); | 156 inline bool IsSmiDouble(double value); |
158 | 157 |
159 | 158 |
160 // Integer32 is an integer that can be represented as a signed 32-bit | 159 // Integer32 is an integer that can be represented as a signed 32-bit |
161 // integer. It has to be in the range [-2^31, 2^31 - 1]. | 160 // integer. It has to be in the range [-2^31, 2^31 - 1]. |
162 // We also have to check for negative 0 as it is not an Integer32. | 161 // We also have to check for negative 0 as it is not an Integer32. |
163 inline bool IsInt32Double(double value); | 162 inline bool IsInt32Double(double value); |
(...skipping 21 matching lines...) Expand all Loading... |
185 inline size_t NumberToSize(Isolate* isolate, Object* number); | 184 inline size_t NumberToSize(Isolate* isolate, Object* number); |
186 | 185 |
187 | 186 |
188 // returns DoubleToString(StringToDouble(string)) == string | 187 // returns DoubleToString(StringToDouble(string)) == string |
189 bool IsSpecialIndex(UnicodeCache* unicode_cache, String* string); | 188 bool IsSpecialIndex(UnicodeCache* unicode_cache, String* string); |
190 | 189 |
191 } // namespace internal | 190 } // namespace internal |
192 } // namespace v8 | 191 } // namespace v8 |
193 | 192 |
194 #endif // V8_CONVERSIONS_H_ | 193 #endif // V8_CONVERSIONS_H_ |
OLD | NEW |