Chromium Code Reviews| 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 26 matching lines...) Expand all Loading... | |
| 37 #include "vm-state-inl.h" | 37 #include "vm-state-inl.h" |
| 38 | 38 |
| 39 #ifdef _MSC_VER | 39 #ifdef _MSC_VER |
| 40 | 40 |
| 41 // Case-insensitive bounded string comparisons. Use stricmp() on Win32. Usually | 41 // Case-insensitive bounded string comparisons. Use stricmp() on Win32. Usually |
| 42 // defined in strings.h. | 42 // defined in strings.h. |
| 43 int strncasecmp(const char* s1, const char* s2, int n) { | 43 int strncasecmp(const char* s1, const char* s2, int n) { |
| 44 return _strnicmp(s1, s2, n); | 44 return _strnicmp(s1, s2, n); |
| 45 } | 45 } |
| 46 | 46 |
| 47 inline int lrint(double flt) { | |
| 48 int intgr; | |
| 49 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X64) | |
| 50 __asm { | |
| 51 fld flt | |
| 52 fistp intgr | |
| 53 }; | |
| 54 #else | |
| 55 #pragma message("Falling back to casting for lrint().") | |
| 56 intgr = static_cast<int>(flt + 0.5); | |
| 57 #endif | |
| 58 return intgr; | |
| 59 } | |
|
Yang
2012/08/22 07:57:07
Maybe it's better to throw a compile error here in
ulan
2012/08/22 13:48:17
I moved it to the header file and implemented the
| |
| 47 #endif // _MSC_VER | 60 #endif // _MSC_VER |
| 48 | 61 |
| 49 | 62 |
| 50 // Extra functions for MinGW. Most of these are the _s functions which are in | 63 // Extra functions for MinGW. Most of these are the _s functions which are in |
| 51 // the Microsoft Visual Studio C++ CRT. | 64 // the Microsoft Visual Studio C++ CRT. |
| 52 #ifdef __MINGW32__ | 65 #ifdef __MINGW32__ |
| 53 | 66 |
| 54 | 67 |
| 55 #ifndef __MINGW64_VERSION_MAJOR | 68 #ifndef __MINGW64_VERSION_MAJOR |
| 56 | 69 |
| (...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2122 | 2135 |
| 2123 | 2136 |
| 2124 void Sampler::Stop() { | 2137 void Sampler::Stop() { |
| 2125 ASSERT(IsActive()); | 2138 ASSERT(IsActive()); |
| 2126 SamplerThread::RemoveActiveSampler(this); | 2139 SamplerThread::RemoveActiveSampler(this); |
| 2127 SetActive(false); | 2140 SetActive(false); |
| 2128 } | 2141 } |
| 2129 | 2142 |
| 2130 | 2143 |
| 2131 } } // namespace v8::internal | 2144 } } // namespace v8::internal |
| OLD | NEW |