| 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 | |
| 56 #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS | 52 #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS |
| 57 #endif // _WIN32 | |
| 58 #else | 53 #else |
| 59 #error Target architecture was not detected as supported by Double-Conversion. | 54 #error Target architecture was not detected as supported by Double-Conversion. |
| 60 #endif | 55 #endif |
| 61 | 56 |
| 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 | |
| 77 #include <stdint.h> | 57 #include <stdint.h> |
| 78 | 58 |
| 79 #endif | |
| 80 | |
| 81 // The following macro works on both 32 and 64-bit platforms. | 59 // The following macro works on both 32 and 64-bit platforms. |
| 82 // Usage: instead of writing 0x1234567890123456 | 60 // Usage: instead of writing 0x1234567890123456 |
| 83 // write UINT64_2PART_C(0x12345678,90123456); | 61 // write UINT64_2PART_C(0x12345678,90123456); |
| 84 #define UINT64_2PART_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) | 62 #define UINT64_2PART_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) |
| 85 | 63 |
| 86 | 64 |
| 87 // The expression ARRAY_SIZE(a) is a compile-time constant of type | 65 // The expression ARRAY_SIZE(a) is a compile-time constant of type |
| 88 // size_t which represents the number of elements of the given | 66 // size_t which represents the number of elements of the given |
| 89 // array. You should only use ARRAY_SIZE on statically allocated | 67 // array. You should only use ARRAY_SIZE on statically allocated |
| 90 // arrays. | 68 // arrays. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 template <class Dest, class Source> | 276 template <class Dest, class Source> |
| 299 inline Dest BitCast(Source* source) { | 277 inline Dest BitCast(Source* source) { |
| 300 return BitCast<Dest>(reinterpret_cast<uintptr_t>(source)); | 278 return BitCast<Dest>(reinterpret_cast<uintptr_t>(source)); |
| 301 } | 279 } |
| 302 | 280 |
| 303 } // namespace double_conversion | 281 } // namespace double_conversion |
| 304 | 282 |
| 305 } // namespace WTF | 283 } // namespace WTF |
| 306 | 284 |
| 307 #endif // DOUBLE_CONVERSION_UTILS_H_ | 285 #endif // DOUBLE_CONVERSION_UTILS_H_ |
| OLD | NEW |