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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // This is the granularity at which the ProtectCode(...) call can set page | 205 // This is the granularity at which the ProtectCode(...) call can set page |
206 // permissions. | 206 // permissions. |
207 static intptr_t CommitPageSize(); | 207 static intptr_t CommitPageSize(); |
208 | 208 |
209 // Mark code segments non-writable. | 209 // Mark code segments non-writable. |
210 static void ProtectCode(void* address, const size_t size); | 210 static void ProtectCode(void* address, const size_t size); |
211 | 211 |
212 // Assign memory as a guard page so that access will cause an exception. | 212 // Assign memory as a guard page so that access will cause an exception. |
213 static void Guard(void* address, const size_t size); | 213 static void Guard(void* address, const size_t size); |
214 | 214 |
| 215 // Set a fixed random seed for the random number generator used for |
| 216 // GetRandomMmapAddr. |
| 217 static void SetRandomSeed(int64_t seed); |
| 218 |
215 // Generate a random address to be used for hinting mmap(). | 219 // Generate a random address to be used for hinting mmap(). |
216 static void* GetRandomMmapAddr(); | 220 static void* GetRandomMmapAddr(); |
217 | 221 |
218 // Get the Alignment guaranteed by Allocate(). | 222 // Get the Alignment guaranteed by Allocate(). |
219 static size_t AllocateAlignment(); | 223 static size_t AllocateAlignment(); |
220 | 224 |
221 // Sleep for a number of milliseconds. | 225 // Sleep for a number of milliseconds. |
222 static void Sleep(const int milliseconds); | 226 static void Sleep(const int milliseconds); |
223 | 227 |
224 // Abort the current process. | 228 // Abort the current process. |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 char name_[kMaxThreadNameLength]; | 507 char name_[kMaxThreadNameLength]; |
504 int stack_size_; | 508 int stack_size_; |
505 Semaphore* start_semaphore_; | 509 Semaphore* start_semaphore_; |
506 | 510 |
507 DISALLOW_COPY_AND_ASSIGN(Thread); | 511 DISALLOW_COPY_AND_ASSIGN(Thread); |
508 }; | 512 }; |
509 | 513 |
510 } } // namespace v8::internal | 514 } } // namespace v8::internal |
511 | 515 |
512 #endif // V8_PLATFORM_H_ | 516 #endif // V8_PLATFORM_H_ |
OLD | NEW |