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. |
11 // The build system then uses the implementation for the target platform. | 11 // The build system then uses the implementation for the target platform. |
12 // | 12 // |
13 // This design has been chosen because it is simple and fast. Alternatively, | 13 // This design has been chosen because it is simple and fast. Alternatively, |
14 // the platform dependent classes could have been implemented using abstract | 14 // the platform dependent classes could have been implemented using abstract |
15 // superclasses with virtual methods and having specializations for each | 15 // superclasses with virtual methods and having specializations for each |
16 // platform. This design was rejected because it was more complicated and | 16 // platform. This design was rejected because it was more complicated and |
17 // slower. It would require factory methods for selecting the right | 17 // slower. It would require factory methods for selecting the right |
18 // implementation and the overhead of virtual methods for performance | 18 // implementation and the overhead of virtual methods for performance |
19 // sensitive like mutex locking/unlocking. | 19 // sensitive like mutex locking/unlocking. |
20 | 20 |
21 #ifndef V8_PLATFORM_H_ | 21 #ifndef V8_PLATFORM_H_ |
22 #define V8_PLATFORM_H_ | 22 #define V8_PLATFORM_H_ |
23 | 23 |
24 #include <stdarg.h> | 24 #include <stdarg.h> |
25 | 25 |
26 #include "platform/mutex.h" | 26 #include "platform/mutex.h" |
27 #include "platform/semaphore.h" | 27 #include "platform/semaphore.h" |
| 28 #include "globals.h" |
28 #include "vector.h" | 29 #include "vector.h" |
29 #include "v8globals.h" | |
30 | 30 |
31 #ifdef __sun | 31 #ifdef __sun |
32 # ifndef signbit | 32 # ifndef signbit |
33 namespace std { | 33 namespace std { |
34 int signbit(double x); | 34 int signbit(double x); |
35 } | 35 } |
36 # endif | 36 # endif |
37 #endif | 37 #endif |
38 | 38 |
39 #if V8_OS_QNX | 39 #if V8_OS_QNX |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 char name_[kMaxThreadNameLength]; | 584 char name_[kMaxThreadNameLength]; |
585 int stack_size_; | 585 int stack_size_; |
586 Semaphore* start_semaphore_; | 586 Semaphore* start_semaphore_; |
587 | 587 |
588 DISALLOW_COPY_AND_ASSIGN(Thread); | 588 DISALLOW_COPY_AND_ASSIGN(Thread); |
589 }; | 589 }; |
590 | 590 |
591 } } // namespace v8::internal | 591 } } // namespace v8::internal |
592 | 592 |
593 #endif // V8_PLATFORM_H_ | 593 #endif // V8_PLATFORM_H_ |
OLD | NEW |