| 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 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 return true; | 1370 return true; |
| 1371 } | 1371 } |
| 1372 | 1372 |
| 1373 | 1373 |
| 1374 bool VirtualMemory::Uncommit(void* address, size_t size) { | 1374 bool VirtualMemory::Uncommit(void* address, size_t size) { |
| 1375 ASSERT(IsReserved()); | 1375 ASSERT(IsReserved()); |
| 1376 return VirtualFree(address, size, MEM_DECOMMIT) != FALSE; | 1376 return VirtualFree(address, size, MEM_DECOMMIT) != FALSE; |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 | 1379 |
| 1380 bool VirtualMemory::Reset(void* address, size_t size, bool is_executable) { |
| 1381 int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; |
| 1382 return NULL != VirtualAlloc(address, size, MEM_RESET, PAGE_READWRITE); |
| 1383 } |
| 1384 |
| 1385 |
| 1380 // ---------------------------------------------------------------------------- | 1386 // ---------------------------------------------------------------------------- |
| 1381 // Win32 thread support. | 1387 // Win32 thread support. |
| 1382 | 1388 |
| 1383 // Definition of invalid thread handle and id. | 1389 // Definition of invalid thread handle and id. |
| 1384 static const HANDLE kNoThread = INVALID_HANDLE_VALUE; | 1390 static const HANDLE kNoThread = INVALID_HANDLE_VALUE; |
| 1385 static const DWORD kNoThreadId = 0; | 1391 static const DWORD kNoThreadId = 0; |
| 1386 | 1392 |
| 1387 | 1393 |
| 1388 class ThreadHandle::PlatformData : public Malloced { | 1394 class ThreadHandle::PlatformData : public Malloced { |
| 1389 public: | 1395 public: |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 | 1905 |
| 1900 // Release the thread handles | 1906 // Release the thread handles |
| 1901 CloseHandle(data_->sampler_thread_); | 1907 CloseHandle(data_->sampler_thread_); |
| 1902 CloseHandle(data_->profiled_thread_); | 1908 CloseHandle(data_->profiled_thread_); |
| 1903 } | 1909 } |
| 1904 | 1910 |
| 1905 | 1911 |
| 1906 #endif // ENABLE_LOGGING_AND_PROFILING | 1912 #endif // ENABLE_LOGGING_AND_PROFILING |
| 1907 | 1913 |
| 1908 } } // namespace v8::internal | 1914 } } // namespace v8::internal |
| OLD | NEW |