| 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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 return 4096; | 792 return 4096; |
| 793 } | 793 } |
| 794 | 794 |
| 795 | 795 |
| 796 void OS::ProtectCode(void* address, const size_t size) { | 796 void OS::ProtectCode(void* address, const size_t size) { |
| 797 DWORD old_protect; | 797 DWORD old_protect; |
| 798 VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect); | 798 VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect); |
| 799 } | 799 } |
| 800 | 800 |
| 801 | 801 |
| 802 void OS::Guard(void* address, const size_t size) { | 802 void OS::Guard(void* const address, size_t const size) { |
| 803 DWORD oldprotect; | 803 DWORD oldprotect; |
| 804 VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect); | 804 VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect); |
| 805 } | 805 } |
| 806 | 806 |
| 807 | 807 |
| 808 void OS::Unguard(void* const address, size_t const size) { |
| 809 DWORD oldprotect; |
| 810 VirtualProtect(address, size, PAGE_READWRITE, &oldprotect); |
| 811 } |
| 812 |
| 813 |
| 808 void OS::Sleep(int milliseconds) { | 814 void OS::Sleep(int milliseconds) { |
| 809 ::Sleep(milliseconds); | 815 ::Sleep(milliseconds); |
| 810 } | 816 } |
| 811 | 817 |
| 812 | 818 |
| 813 void OS::Abort() { | 819 void OS::Abort() { |
| 814 if (g_hard_abort) { | 820 if (g_hard_abort) { |
| 815 V8_IMMEDIATE_CRASH(); | 821 V8_IMMEDIATE_CRASH(); |
| 816 } | 822 } |
| 817 // Make the MSVCRT do a silent abort. | 823 // Make the MSVCRT do a silent abort. |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 DCHECK(result); | 1387 DCHECK(result); |
| 1382 } | 1388 } |
| 1383 | 1389 |
| 1384 | 1390 |
| 1385 | 1391 |
| 1386 void Thread::YieldCPU() { | 1392 void Thread::YieldCPU() { |
| 1387 Sleep(0); | 1393 Sleep(0); |
| 1388 } | 1394 } |
| 1389 | 1395 |
| 1390 } } // namespace v8::base | 1396 } } // namespace v8::base |
| OLD | NEW |