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 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
7 | 7 |
8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/cpu_dbc.h" |
9 | 10 |
| 11 #include "vm/cpuinfo.h" |
10 | 12 |
11 namespace dart { | 13 namespace dart { |
12 | 14 |
13 | |
14 void CPU::FlushICache(uword start, uword size) { | 15 void CPU::FlushICache(uword start, uword size) { |
15 // Nothing to do. | 16 // Nothing to do. |
16 } | 17 } |
17 | 18 |
18 | 19 |
19 const char* CPU::Id() { | 20 const char* CPU::Id() { |
20 return "dbc"; | 21 return "dbc"; |
21 } | 22 } |
22 | 23 |
23 | 24 |
| 25 const char* HostCPUFeatures::hardware_ = NULL; |
| 26 #if defined(DEBUG) |
| 27 bool HostCPUFeatures::initialized_ = false; |
| 28 #endif |
| 29 |
| 30 void HostCPUFeatures::InitOnce() { |
| 31 CpuInfo::InitOnce(); |
| 32 hardware_ = CpuInfo::GetCpuModel(); |
| 33 #if defined(DEBUG) |
| 34 initialized_ = true; |
| 35 #endif |
| 36 } |
| 37 |
| 38 |
| 39 void HostCPUFeatures::Cleanup() { |
| 40 DEBUG_ASSERT(initialized_); |
| 41 #if defined(DEBUG) |
| 42 initialized_ = false; |
| 43 #endif |
| 44 ASSERT(hardware_ != NULL); |
| 45 free(const_cast<char*>(hardware_)); |
| 46 hardware_ = NULL; |
| 47 CpuInfo::Cleanup(); |
| 48 } |
| 49 |
24 } // namespace dart | 50 } // namespace dart |
25 | 51 |
26 #endif // defined TARGET_ARCH_DBC | 52 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |