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 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; | 1479 int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; |
1480 if (NULL == VirtualAlloc(base, size, MEM_COMMIT, prot)) { | 1480 if (NULL == VirtualAlloc(base, size, MEM_COMMIT, prot)) { |
1481 return false; | 1481 return false; |
1482 } | 1482 } |
1483 | 1483 |
1484 UpdateAllocatedSpaceLimits(base, static_cast<int>(size)); | 1484 UpdateAllocatedSpaceLimits(base, static_cast<int>(size)); |
1485 return true; | 1485 return true; |
1486 } | 1486 } |
1487 | 1487 |
1488 | 1488 |
| 1489 bool VirtualMemory::Guard(void* address) { |
| 1490 if (NULL == VirtualAlloc(address, |
| 1491 OS::CommitPageSize(), |
| 1492 MEM_COMMIT, |
| 1493 PAGE_READONLY | PAGE_GUARD)) { |
| 1494 return false; |
| 1495 } |
| 1496 return true; |
| 1497 } |
| 1498 |
| 1499 |
1489 bool VirtualMemory::UncommitRegion(void* base, size_t size) { | 1500 bool VirtualMemory::UncommitRegion(void* base, size_t size) { |
1490 return VirtualFree(base, size, MEM_DECOMMIT) != 0; | 1501 return VirtualFree(base, size, MEM_DECOMMIT) != 0; |
1491 } | 1502 } |
1492 | 1503 |
1493 | 1504 |
1494 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { | 1505 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { |
1495 return VirtualFree(base, 0, MEM_RELEASE) != 0; | 1506 return VirtualFree(base, 0, MEM_RELEASE) != 0; |
1496 } | 1507 } |
1497 | 1508 |
1498 | 1509 |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 | 2045 |
2035 | 2046 |
2036 void Sampler::Stop() { | 2047 void Sampler::Stop() { |
2037 ASSERT(IsActive()); | 2048 ASSERT(IsActive()); |
2038 SamplerThread::RemoveActiveSampler(this); | 2049 SamplerThread::RemoveActiveSampler(this); |
2039 SetActive(false); | 2050 SetActive(false); |
2040 } | 2051 } |
2041 | 2052 |
2042 | 2053 |
2043 } } // namespace v8::internal | 2054 } } // namespace v8::internal |
OLD | NEW |