OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 } | 950 } |
951 | 951 |
952 | 952 |
953 void OS::Free(void* address, const size_t size) { | 953 void OS::Free(void* address, const size_t size) { |
954 // TODO(1240712): VirtualFree has a return value which is ignored here. | 954 // TODO(1240712): VirtualFree has a return value which is ignored here. |
955 VirtualFree(address, 0, MEM_RELEASE); | 955 VirtualFree(address, 0, MEM_RELEASE); |
956 USE(size); | 956 USE(size); |
957 } | 957 } |
958 | 958 |
959 | 959 |
| 960 void OS::ProtectCode(void* address, const size_t size) { |
| 961 DWORD old_protect; |
| 962 VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect); |
| 963 } |
| 964 |
| 965 |
960 void OS::Guard(void* address, const size_t size) { | 966 void OS::Guard(void* address, const size_t size) { |
961 DWORD oldprotect; | 967 DWORD oldprotect; |
962 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); | 968 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); |
963 } | 969 } |
964 | 970 |
965 | 971 |
966 void OS::Sleep(int milliseconds) { | 972 void OS::Sleep(int milliseconds) { |
967 ::Sleep(milliseconds); | 973 ::Sleep(milliseconds); |
968 } | 974 } |
969 | 975 |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2032 | 2038 |
2033 | 2039 |
2034 void Sampler::Stop() { | 2040 void Sampler::Stop() { |
2035 ASSERT(IsActive()); | 2041 ASSERT(IsActive()); |
2036 SamplerThread::RemoveActiveSampler(this); | 2042 SamplerThread::RemoveActiveSampler(this); |
2037 SetActive(false); | 2043 SetActive(false); |
2038 } | 2044 } |
2039 | 2045 |
2040 | 2046 |
2041 } } // namespace v8::internal | 2047 } } // namespace v8::internal |
OLD | NEW |