| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // and the same size it was reserved with. | 356 // and the same size it was reserved with. |
| 357 static bool ReleaseRegion(void* base, size_t size); | 357 static bool ReleaseRegion(void* base, size_t size); |
| 358 | 358 |
| 359 // Returns true if OS performs lazy commits, i.e. the memory allocation call | 359 // Returns true if OS performs lazy commits, i.e. the memory allocation call |
| 360 // defers actual physical memory allocation till the first memory access. | 360 // defers actual physical memory allocation till the first memory access. |
| 361 // Otherwise returns false. | 361 // Otherwise returns false. |
| 362 static bool HasLazyCommits(); | 362 static bool HasLazyCommits(); |
| 363 | 363 |
| 364 private: | 364 private: |
| 365 bool InVM(void* address, size_t size) { | 365 bool InVM(void* address, size_t size) { |
| 366 return (reinterpret_cast<intptr_t>(address_) <= | 366 return (reinterpret_cast<uintptr_t>(address_) <= |
| 367 reinterpret_cast<intptr_t>(address)) && | 367 reinterpret_cast<uintptr_t>(address)) && |
| 368 (reinterpret_cast<intptr_t>(address_) + size_ >= | 368 ((reinterpret_cast<uintptr_t>(address_) + size_) >= |
| 369 reinterpret_cast<intptr_t>(address) + size); | 369 (reinterpret_cast<uintptr_t>(address) + size)); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void* address_; // Start address of the virtual memory. | 372 void* address_; // Start address of the virtual memory. |
| 373 size_t size_; // Size of the virtual memory. | 373 size_t size_; // Size of the virtual memory. |
| 374 }; | 374 }; |
| 375 | 375 |
| 376 | 376 |
| 377 // ---------------------------------------------------------------------------- | 377 // ---------------------------------------------------------------------------- |
| 378 // Thread | 378 // Thread |
| 379 // | 379 // |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 char name_[kMaxThreadNameLength]; | 475 char name_[kMaxThreadNameLength]; |
| 476 int stack_size_; | 476 int stack_size_; |
| 477 Semaphore* start_semaphore_; | 477 Semaphore* start_semaphore_; |
| 478 | 478 |
| 479 DISALLOW_COPY_AND_ASSIGN(Thread); | 479 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 480 }; | 480 }; |
| 481 | 481 |
| 482 } } // namespace v8::base | 482 } } // namespace v8::base |
| 483 | 483 |
| 484 #endif // V8_BASE_PLATFORM_PLATFORM_H_ | 484 #endif // V8_BASE_PLATFORM_PLATFORM_H_ |
| OLD | NEW |