Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: runtime/vm/cpu_dbc.cc

Issue 1928473003: DBC: Enable CpuInfo test (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/cpu_dbc.h ('k') | runtime/vm/cpuinfo_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « runtime/vm/cpu_dbc.h ('k') | runtime/vm/cpuinfo_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698