OLD | NEW |
1 // Copyright 2006-2013 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2013 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 architecture-specific code. This make the rest of | 5 // This module contains the architecture-specific code. This make the rest of |
6 // the code less dependent on differences between different processor | 6 // the code less dependent on differences between different processor |
7 // architecture. | 7 // architecture. |
8 // The classes have the same definition for all architectures. The | 8 // The classes have the same definition for all architectures. The |
9 // implementation for a particular architecture is put in cpu_<arch>.cc. | 9 // implementation for a particular architecture is put in cpu_<arch>.cc. |
10 // The build system then uses the implementation for the target architecture. | 10 // The build system then uses the implementation for the target architecture. |
11 // | 11 // |
12 | 12 |
13 #ifndef V8_BASE_CPU_H_ | 13 #ifndef V8_BASE_CPU_H_ |
14 #define V8_BASE_CPU_H_ | 14 #define V8_BASE_CPU_H_ |
15 | 15 |
16 #include "src/base/base-export.h" | |
17 #include "src/base/macros.h" | 16 #include "src/base/macros.h" |
18 | 17 |
19 namespace v8 { | 18 namespace v8 { |
20 namespace base { | 19 namespace base { |
21 | 20 |
22 // ---------------------------------------------------------------------------- | 21 // ---------------------------------------------------------------------------- |
23 // CPU | 22 // CPU |
24 // | 23 // |
25 // Query information about the processor. | 24 // Query information about the processor. |
26 // | 25 // |
27 // This class also has static methods for the architecture specific functions. | 26 // This class also has static methods for the architecture specific functions. |
28 // Add methods here to cope with differences between the supported | 27 // Add methods here to cope with differences between the supported |
29 // architectures. For each architecture the file cpu_<arch>.cc contains the | 28 // architectures. For each architecture the file cpu_<arch>.cc contains the |
30 // implementation of these static functions. | 29 // implementation of these static functions. |
31 | 30 |
32 class V8_BASE_EXPORT CPU final { | 31 class CPU final { |
33 public: | 32 public: |
34 CPU(); | 33 CPU(); |
35 | 34 |
36 // x86 CPUID information | 35 // x86 CPUID information |
37 const char* vendor() const { return vendor_; } | 36 const char* vendor() const { return vendor_; } |
38 int stepping() const { return stepping_; } | 37 int stepping() const { return stepping_; } |
39 int model() const { return model_; } | 38 int model() const { return model_; } |
40 int ext_model() const { return ext_model_; } | 39 int ext_model() const { return ext_model_; } |
41 int family() const { return family_; } | 40 int family() const { return family_; } |
42 int ext_family() const { return ext_family_; } | 41 int ext_family() const { return ext_family_; } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 bool has_vfp3_; | 151 bool has_vfp3_; |
153 bool has_vfp3_d32_; | 152 bool has_vfp3_d32_; |
154 bool is_fp64_mode_; | 153 bool is_fp64_mode_; |
155 bool has_non_stop_time_stamp_counter_; | 154 bool has_non_stop_time_stamp_counter_; |
156 }; | 155 }; |
157 | 156 |
158 } // namespace base | 157 } // namespace base |
159 } // namespace v8 | 158 } // namespace v8 |
160 | 159 |
161 #endif // V8_BASE_CPU_H_ | 160 #endif // V8_BASE_CPU_H_ |
OLD | NEW |