| 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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 DWORD oldprotect; | 984 DWORD oldprotect; |
| 985 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); | 985 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); |
| 986 } | 986 } |
| 987 | 987 |
| 988 | 988 |
| 989 void OS::Sleep(int milliseconds) { | 989 void OS::Sleep(int milliseconds) { |
| 990 ::Sleep(milliseconds); | 990 ::Sleep(milliseconds); |
| 991 } | 991 } |
| 992 | 992 |
| 993 | 993 |
| 994 int OS::NumberOfCores() { | |
| 995 SYSTEM_INFO info; | |
| 996 GetSystemInfo(&info); | |
| 997 return info.dwNumberOfProcessors; | |
| 998 } | |
| 999 | |
| 1000 | |
| 1001 void OS::Abort() { | 994 void OS::Abort() { |
| 1002 if (IsDebuggerPresent() || FLAG_break_on_abort) { | 995 if (IsDebuggerPresent() || FLAG_break_on_abort) { |
| 1003 DebugBreak(); | 996 DebugBreak(); |
| 1004 } else { | 997 } else { |
| 1005 // Make the MSVCRT do a silent abort. | 998 // Make the MSVCRT do a silent abort. |
| 1006 raise(SIGABRT); | 999 raise(SIGABRT); |
| 1007 } | 1000 } |
| 1008 } | 1001 } |
| 1009 | 1002 |
| 1010 | 1003 |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1993 limit_mutex = CreateMutex(); | 1986 limit_mutex = CreateMutex(); |
| 1994 } | 1987 } |
| 1995 | 1988 |
| 1996 | 1989 |
| 1997 void OS::TearDown() { | 1990 void OS::TearDown() { |
| 1998 delete limit_mutex; | 1991 delete limit_mutex; |
| 1999 } | 1992 } |
| 2000 | 1993 |
| 2001 | 1994 |
| 2002 } } // namespace v8::internal | 1995 } } // namespace v8::internal |
| OLD | NEW |