| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 int signbit(double x); | 57 int signbit(double x); |
| 58 } | 58 } |
| 59 # endif | 59 # endif |
| 60 #endif | 60 #endif |
| 61 | 61 |
| 62 #if V8_OS_QNX | 62 #if V8_OS_QNX |
| 63 #include "qnx-math.h" | 63 #include "qnx-math.h" |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 // Microsoft Visual C++ specific stuff. | 66 // Microsoft Visual C++ specific stuff. |
| 67 #if V8_CC_MSVC | 67 #if V8_LIBC_MSVCRT |
| 68 | 68 |
| 69 #include "win32-headers.h" | 69 #include "win32-headers.h" |
| 70 #include "win32-math.h" | 70 #include "win32-math.h" |
| 71 | 71 |
| 72 int strncasecmp(const char* s1, const char* s2, int n); | 72 int strncasecmp(const char* s1, const char* s2, int n); |
| 73 | 73 |
| 74 // Visual C++ 2013 and higher implement this function. | 74 // Visual C++ 2013 and higher implement this function. |
| 75 #if (_MSC_VER < 1800) | 75 #if (_MSC_VER < 1800) |
| 76 inline int lrint(double flt) { | 76 inline int lrint(double flt) { |
| 77 int intgr; | 77 int intgr; |
| 78 #if V8_TARGET_ARCH_IA32 | 78 #if V8_TARGET_ARCH_IA32 |
| 79 __asm { | 79 __asm { |
| 80 fld flt | 80 fld flt |
| 81 fistp intgr | 81 fistp intgr |
| 82 }; | 82 }; |
| 83 #else | 83 #else |
| 84 intgr = static_cast<int>(flt + 0.5); | 84 intgr = static_cast<int>(flt + 0.5); |
| 85 if ((intgr & 1) != 0 && intgr - flt == 0.5) { | 85 if ((intgr & 1) != 0 && intgr - flt == 0.5) { |
| 86 // If the number is halfway between two integers, round to the even one. | 86 // If the number is halfway between two integers, round to the even one. |
| 87 intgr--; | 87 intgr--; |
| 88 } | 88 } |
| 89 #endif | 89 #endif |
| 90 return intgr; | 90 return intgr; |
| 91 } | 91 } |
| 92 #endif // _MSC_VER < 1800 | 92 #endif // _MSC_VER < 1800 |
| 93 | 93 |
| 94 #endif // V8_CC_MSVC | 94 #endif // V8_LIBC_MSVCRT |
| 95 | 95 |
| 96 namespace v8 { | 96 namespace v8 { |
| 97 namespace internal { | 97 namespace internal { |
| 98 | 98 |
| 99 double modulo(double x, double y); | 99 double modulo(double x, double y); |
| 100 | 100 |
| 101 // Custom implementation of math functions. | 101 // Custom implementation of math functions. |
| 102 double fast_exp(double input); | 102 double fast_exp(double input); |
| 103 double fast_sqrt(double input); | 103 double fast_sqrt(double input); |
| 104 // The custom exp implementation needs 16KB of lookup data; initialize it | 104 // The custom exp implementation needs 16KB of lookup data; initialize it |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 char name_[kMaxThreadNameLength]; | 610 char name_[kMaxThreadNameLength]; |
| 611 int stack_size_; | 611 int stack_size_; |
| 612 Semaphore* start_semaphore_; | 612 Semaphore* start_semaphore_; |
| 613 | 613 |
| 614 DISALLOW_COPY_AND_ASSIGN(Thread); | 614 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 615 }; | 615 }; |
| 616 | 616 |
| 617 } } // namespace v8::internal | 617 } } // namespace v8::internal |
| 618 | 618 |
| 619 #endif // V8_PLATFORM_H_ | 619 #endif // V8_PLATFORM_H_ |
| OLD | NEW |