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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/cpu_dbc.h ('k') | runtime/vm/cpuinfo_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/cpu_dbc.cc
diff --git a/runtime/vm/cpu_dbc.cc b/runtime/vm/cpu_dbc.cc
index 8fcff5bb58f98d560cf4fbf70b095d7e8847a761..0e61fbd49769cc305662611b172624cf5a452efa 100644
--- a/runtime/vm/cpu_dbc.cc
+++ b/runtime/vm/cpu_dbc.cc
@@ -6,11 +6,12 @@
#if defined(TARGET_ARCH_DBC)
#include "vm/cpu.h"
+#include "vm/cpu_dbc.h"
+#include "vm/cpuinfo.h"
namespace dart {
-
void CPU::FlushICache(uword start, uword size) {
// Nothing to do.
}
@@ -21,6 +22,31 @@ const char* CPU::Id() {
}
+const char* HostCPUFeatures::hardware_ = NULL;
+#if defined(DEBUG)
+bool HostCPUFeatures::initialized_ = false;
+#endif
+
+void HostCPUFeatures::InitOnce() {
+ CpuInfo::InitOnce();
+ hardware_ = CpuInfo::GetCpuModel();
+#if defined(DEBUG)
+ initialized_ = true;
+#endif
+}
+
+
+void HostCPUFeatures::Cleanup() {
+ DEBUG_ASSERT(initialized_);
+#if defined(DEBUG)
+ initialized_ = false;
+#endif
+ ASSERT(hardware_ != NULL);
+ free(const_cast<char*>(hardware_));
+ hardware_ = NULL;
+ CpuInfo::Cleanup();
+}
+
} // namespace dart
#endif // defined TARGET_ARCH_DBC
« 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