| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // the result is equal to 89255e-22. | 42 // the result is equal to 89255e-22. |
| 43 // The best way to test this, is to create a division-function and to compare | 43 // The best way to test this, is to create a division-function and to compare |
| 44 // the output of the division with the expected result. (Inlining must be | 44 // the output of the division with the expected result. (Inlining must be |
| 45 // disabled.) | 45 // disabled.) |
| 46 // On Linux,x86 89255e-22 != Div_double(89255.0/1e22) | 46 // On Linux,x86 89255e-22 != Div_double(89255.0/1e22) |
| 47 #if defined(_M_X64) || defined(__x86_64__) || \ | 47 #if defined(_M_X64) || defined(__x86_64__) || \ |
| 48 defined(__ARMEL__) || defined(__aarch64__) || \ | 48 defined(__ARMEL__) || defined(__aarch64__) || \ |
| 49 defined(__MIPSEL__) | 49 defined(__MIPSEL__) |
| 50 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 | 50 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 |
| 51 #elif defined(_M_IX86) || defined(__i386__) | 51 #elif defined(_M_IX86) || defined(__i386__) |
| 52 #if defined(_WIN32) |
| 53 // Windows uses a 64bit wide floating point stack. |
| 54 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 |
| 55 #else |
| 52 #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS | 56 #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS |
| 57 #endif // _WIN32 |
| 53 #else | 58 #else |
| 54 #error Target architecture was not detected as supported by Double-Conversion. | 59 #error Target architecture was not detected as supported by Double-Conversion. |
| 55 #endif | 60 #endif |
| 56 | 61 |
| 62 |
| 63 #if defined(_WIN32) && !defined(__MINGW32__) |
| 64 |
| 65 typedef signed char int8_t; |
| 66 typedef unsigned char uint8_t; |
| 67 typedef short int16_t; // NOLINT |
| 68 typedef unsigned short uint16_t; // NOLINT |
| 69 typedef int int32_t; |
| 70 typedef unsigned int uint32_t; |
| 71 typedef __int64 int64_t; |
| 72 typedef unsigned __int64 uint64_t; |
| 73 // intptr_t and friends are defined in crtdefs.h through stdio.h. |
| 74 |
| 75 #else |
| 76 |
| 57 #include <stdint.h> | 77 #include <stdint.h> |
| 58 | 78 |
| 79 #endif |
| 80 |
| 59 // The following macro works on both 32 and 64-bit platforms. | 81 // The following macro works on both 32 and 64-bit platforms. |
| 60 // Usage: instead of writing 0x1234567890123456 | 82 // Usage: instead of writing 0x1234567890123456 |
| 61 // write UINT64_2PART_C(0x12345678,90123456); | 83 // write UINT64_2PART_C(0x12345678,90123456); |
| 62 #define UINT64_2PART_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) | 84 #define UINT64_2PART_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) |
| 63 | 85 |
| 64 | 86 |
| 65 // The expression ARRAY_SIZE(a) is a compile-time constant of type | 87 // The expression ARRAY_SIZE(a) is a compile-time constant of type |
| 66 // size_t which represents the number of elements of the given | 88 // size_t which represents the number of elements of the given |
| 67 // array. You should only use ARRAY_SIZE on statically allocated | 89 // array. You should only use ARRAY_SIZE on statically allocated |
| 68 // arrays. | 90 // arrays. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 template <class Dest, class Source> | 298 template <class Dest, class Source> |
| 277 inline Dest BitCast(Source* source) { | 299 inline Dest BitCast(Source* source) { |
| 278 return BitCast<Dest>(reinterpret_cast<uintptr_t>(source)); | 300 return BitCast<Dest>(reinterpret_cast<uintptr_t>(source)); |
| 279 } | 301 } |
| 280 | 302 |
| 281 } // namespace double_conversion | 303 } // namespace double_conversion |
| 282 | 304 |
| 283 } // namespace WTF | 305 } // namespace WTF |
| 284 | 306 |
| 285 #endif // DOUBLE_CONVERSION_UTILS_H_ | 307 #endif // DOUBLE_CONVERSION_UTILS_H_ |
| OLD | NEW |