| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 // Platform-specific code for Win32. | 5 // Platform-specific code for Win32. |
| 6 | 6 |
| 7 // Secure API functions are not available using MinGW with msvcrt.dll | 7 // Secure API functions are not available using MinGW with msvcrt.dll |
| 8 // on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to | 8 // on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to |
| 9 // disable definition of secure API functions in standard headers that | 9 // disable definition of secure API functions in standard headers that |
| 10 // would conflict with our own implementation. | 10 // would conflict with our own implementation. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 namespace v8 { | 107 namespace v8 { |
| 108 namespace base { | 108 namespace base { |
| 109 | 109 |
| 110 namespace { | 110 namespace { |
| 111 | 111 |
| 112 bool g_hard_abort = false; | 112 bool g_hard_abort = false; |
| 113 | 113 |
| 114 } // namespace | 114 } // namespace |
| 115 | 115 |
| 116 intptr_t OS::MaxVirtualMemory() { | |
| 117 return 0; | |
| 118 } | |
| 119 | |
| 120 | |
| 121 class TimezoneCache { | 116 class TimezoneCache { |
| 122 public: | 117 public: |
| 123 TimezoneCache() : initialized_(false) { } | 118 TimezoneCache() : initialized_(false) { } |
| 124 | 119 |
| 125 void Clear() { | 120 void Clear() { |
| 126 initialized_ = false; | 121 initialized_ = false; |
| 127 } | 122 } |
| 128 | 123 |
| 129 // Initialize timezone information. The timezone information is obtained from | 124 // Initialize timezone information. The timezone information is obtained from |
| 130 // windows. If we cannot get the timezone information we fall back to CET. | 125 // windows. If we cannot get the timezone information we fall back to CET. |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 if (!LoadDbgHelpAndTlHelp32()) return std::vector<OS::SharedLibraryAddress>(); | 1156 if (!LoadDbgHelpAndTlHelp32()) return std::vector<OS::SharedLibraryAddress>(); |
| 1162 HANDLE process_handle = GetCurrentProcess(); | 1157 HANDLE process_handle = GetCurrentProcess(); |
| 1163 return LoadSymbols(process_handle); | 1158 return LoadSymbols(process_handle); |
| 1164 } | 1159 } |
| 1165 | 1160 |
| 1166 | 1161 |
| 1167 void OS::SignalCodeMovingGC() { | 1162 void OS::SignalCodeMovingGC() { |
| 1168 } | 1163 } |
| 1169 | 1164 |
| 1170 | 1165 |
| 1171 uint64_t OS::TotalPhysicalMemory() { | |
| 1172 MEMORYSTATUSEX memory_info; | |
| 1173 memory_info.dwLength = sizeof(memory_info); | |
| 1174 if (!GlobalMemoryStatusEx(&memory_info)) { | |
| 1175 UNREACHABLE(); | |
| 1176 return 0; | |
| 1177 } | |
| 1178 | |
| 1179 return static_cast<uint64_t>(memory_info.ullTotalPhys); | |
| 1180 } | |
| 1181 | |
| 1182 | |
| 1183 #else // __MINGW32__ | 1166 #else // __MINGW32__ |
| 1184 std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() { | 1167 std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() { |
| 1185 return std::vector<OS::SharedLibraryAddress>(); | 1168 return std::vector<OS::SharedLibraryAddress>(); |
| 1186 } | 1169 } |
| 1187 | 1170 |
| 1188 | 1171 |
| 1189 void OS::SignalCodeMovingGC() { } | 1172 void OS::SignalCodeMovingGC() { } |
| 1190 #endif // __MINGW32__ | 1173 #endif // __MINGW32__ |
| 1191 | 1174 |
| 1192 | 1175 |
| 1193 int OS::NumberOfProcessorsOnline() { | |
| 1194 SYSTEM_INFO info; | |
| 1195 GetSystemInfo(&info); | |
| 1196 return info.dwNumberOfProcessors; | |
| 1197 } | |
| 1198 | |
| 1199 | |
| 1200 double OS::nan_value() { | 1176 double OS::nan_value() { |
| 1201 #ifdef _MSC_VER | 1177 #ifdef _MSC_VER |
| 1202 return std::numeric_limits<double>::quiet_NaN(); | 1178 return std::numeric_limits<double>::quiet_NaN(); |
| 1203 #else // _MSC_VER | 1179 #else // _MSC_VER |
| 1204 return NAN; | 1180 return NAN; |
| 1205 #endif // _MSC_VER | 1181 #endif // _MSC_VER |
| 1206 } | 1182 } |
| 1207 | 1183 |
| 1208 | 1184 |
| 1209 int OS::ActivationFrameAlignment() { | 1185 int OS::ActivationFrameAlignment() { |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 DCHECK(result); | 1396 DCHECK(result); |
| 1421 } | 1397 } |
| 1422 | 1398 |
| 1423 | 1399 |
| 1424 | 1400 |
| 1425 void Thread::YieldCPU() { | 1401 void Thread::YieldCPU() { |
| 1426 Sleep(0); | 1402 Sleep(0); |
| 1427 } | 1403 } |
| 1428 | 1404 |
| 1429 } } // namespace v8::base | 1405 } } // namespace v8::base |
| OLD | NEW |