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 // This module contains the platform-specific code. This make the rest of the | 5 // This module contains the platform-specific code. This make the rest of the |
6 // code less dependent on operating system, compilers and runtime libraries. | 6 // code less dependent on operating system, compilers and runtime libraries. |
7 // This module does specifically not deal with differences between different | 7 // This module does specifically not deal with differences between different |
8 // processor architecture. | 8 // processor architecture. |
9 // The platform classes have the same definition for all platforms. The | 9 // The platform classes have the same definition for all platforms. The |
10 // implementation for a particular platform is put in platform_<os>.cc. | 10 // implementation for a particular platform is put in platform_<os>.cc. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // This is the granularity at which the ProtectCode(...) call can set page | 181 // This is the granularity at which the ProtectCode(...) call can set page |
182 // permissions. | 182 // permissions. |
183 static intptr_t CommitPageSize(); | 183 static intptr_t CommitPageSize(); |
184 | 184 |
185 // Mark code segments non-writable. | 185 // Mark code segments non-writable. |
186 static void ProtectCode(void* address, const size_t size); | 186 static void ProtectCode(void* address, const size_t size); |
187 | 187 |
188 // Assign memory as a guard page so that access will cause an exception. | 188 // Assign memory as a guard page so that access will cause an exception. |
189 static void Guard(void* address, const size_t size); | 189 static void Guard(void* address, const size_t size); |
190 | 190 |
| 191 // Make a region of memory readable and writable. |
| 192 static void Unprotect(void* address, const size_t size); |
| 193 |
191 // Generate a random address to be used for hinting mmap(). | 194 // Generate a random address to be used for hinting mmap(). |
192 static void* GetRandomMmapAddr(); | 195 static void* GetRandomMmapAddr(); |
193 | 196 |
194 // Get the Alignment guaranteed by Allocate(). | 197 // Get the Alignment guaranteed by Allocate(). |
195 static size_t AllocateAlignment(); | 198 static size_t AllocateAlignment(); |
196 | 199 |
197 // Sleep for a specified time interval. | 200 // Sleep for a specified time interval. |
198 static void Sleep(TimeDelta interval); | 201 static void Sleep(TimeDelta interval); |
199 | 202 |
200 // Abort the current process. | 203 // Abort the current process. |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 int stack_size_; | 516 int stack_size_; |
514 Semaphore* start_semaphore_; | 517 Semaphore* start_semaphore_; |
515 | 518 |
516 DISALLOW_COPY_AND_ASSIGN(Thread); | 519 DISALLOW_COPY_AND_ASSIGN(Thread); |
517 }; | 520 }; |
518 | 521 |
519 } // namespace base | 522 } // namespace base |
520 } // namespace v8 | 523 } // namespace v8 |
521 | 524 |
522 #endif // V8_BASE_PLATFORM_PLATFORM_H_ | 525 #endif // V8_BASE_PLATFORM_PLATFORM_H_ |
OLD | NEW |