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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 DWORD oldprotect; | 961 DWORD oldprotect; |
962 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); | 962 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); |
963 } | 963 } |
964 | 964 |
965 | 965 |
966 void OS::Sleep(int milliseconds) { | 966 void OS::Sleep(int milliseconds) { |
967 ::Sleep(milliseconds); | 967 ::Sleep(milliseconds); |
968 } | 968 } |
969 | 969 |
970 | 970 |
| 971 int OS::NumberOfCores() { |
| 972 SYSTEM_INFO info; |
| 973 GetSystemInfo(&info); |
| 974 return info.dwNumberOfProcessors; |
| 975 } |
| 976 |
| 977 |
971 void OS::Abort() { | 978 void OS::Abort() { |
972 if (IsDebuggerPresent() || FLAG_break_on_abort) { | 979 if (IsDebuggerPresent() || FLAG_break_on_abort) { |
973 DebugBreak(); | 980 DebugBreak(); |
974 } else { | 981 } else { |
975 // Make the MSVCRT do a silent abort. | 982 // Make the MSVCRT do a silent abort. |
976 raise(SIGABRT); | 983 raise(SIGABRT); |
977 } | 984 } |
978 } | 985 } |
979 | 986 |
980 | 987 |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 | 2132 |
2126 | 2133 |
2127 void Sampler::Stop() { | 2134 void Sampler::Stop() { |
2128 ASSERT(IsActive()); | 2135 ASSERT(IsActive()); |
2129 SamplerThread::RemoveActiveSampler(this); | 2136 SamplerThread::RemoveActiveSampler(this); |
2130 SetActive(false); | 2137 SetActive(false); |
2131 } | 2138 } |
2132 | 2139 |
2133 | 2140 |
2134 } } // namespace v8::internal | 2141 } } // namespace v8::internal |
OLD | NEW |