OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef RUNTIME_VM_CPU_DBC_H_ | 5 #ifndef RUNTIME_VM_CPU_DBC_H_ |
6 #define RUNTIME_VM_CPU_DBC_H_ | 6 #define RUNTIME_VM_CPU_DBC_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/simulator.h" | 9 #include "vm/simulator.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 class HostCPUFeatures: public AllStatic { | 13 class HostCPUFeatures : public AllStatic { |
14 public: | 14 public: |
15 static void InitOnce(); | 15 static void InitOnce(); |
16 static void Cleanup(); | 16 static void Cleanup(); |
17 | 17 |
18 static const char* hardware() { | 18 static const char* hardware() { |
19 DEBUG_ASSERT(initialized_); | 19 DEBUG_ASSERT(initialized_); |
20 return hardware_; | 20 return hardware_; |
21 } | 21 } |
22 | 22 |
23 private: | 23 private: |
24 static const char* hardware_; | 24 static const char* hardware_; |
25 #if defined(DEBUG) | 25 #if defined(DEBUG) |
26 static bool initialized_; | 26 static bool initialized_; |
27 #endif | 27 #endif |
28 }; | 28 }; |
29 | 29 |
30 class TargetCPUFeatures : public AllStatic { | 30 class TargetCPUFeatures : public AllStatic { |
31 public: | 31 public: |
32 static void InitOnce() { | 32 static void InitOnce() { HostCPUFeatures::InitOnce(); } |
33 HostCPUFeatures::InitOnce(); | 33 static void Cleanup() { HostCPUFeatures::Cleanup(); } |
34 } | |
35 static void Cleanup() { | |
36 HostCPUFeatures::Cleanup(); | |
37 } | |
38 | 34 |
39 static const char* hardware() { | 35 static const char* hardware() { return CPU::Id(); } |
40 return CPU::Id(); | |
41 } | |
42 | 36 |
43 static bool double_truncate_round_supported() { | 37 static bool double_truncate_round_supported() { return true; } |
44 return true; | |
45 } | |
46 }; | 38 }; |
47 | 39 |
48 } // namespace dart | 40 } // namespace dart |
49 | 41 |
50 #endif // RUNTIME_VM_CPU_DBC_H_ | 42 #endif // RUNTIME_VM_CPU_DBC_H_ |
OLD | NEW |