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

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

Issue 136303012: Updates refactoring of CPU feature detection (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/cpu_x64.h ('k') | runtime/vm/cpuid.h » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 6
7 #if defined(TARGET_ARCH_X64) 7 #if defined(TARGET_ARCH_X64)
8 8
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 10
11 #include "vm/assembler.h"
11 #include "vm/constants_x64.h" 12 #include "vm/constants_x64.h"
13 #include "vm/cpuinfo.h"
12 #include "vm/heap.h" 14 #include "vm/heap.h"
13 #include "vm/isolate.h" 15 #include "vm/isolate.h"
14 #include "vm/object.h" 16 #include "vm/object.h"
15 17
16 namespace dart { 18 namespace dart {
17 19
20 DEFINE_FLAG(bool, use_sse41, true, "Use SSE 4.1 if available");
21
22
18 void CPU::FlushICache(uword start, uword size) { 23 void CPU::FlushICache(uword start, uword size) {
19 // Nothing to be done here. 24 // Nothing to be done here.
20 } 25 }
21 26
22 27
23 const char* CPU::Id() { 28 const char* CPU::Id() {
24 return "x64"; 29 return "x64";
25 } 30 }
26 31
32
33 bool HostCPUFeatures::sse2_supported_ = true;
34 bool HostCPUFeatures::sse4_1_supported_ = false;
35 const char* HostCPUFeatures::hardware_ = NULL;
36 #if defined(DEBUG)
37 bool HostCPUFeatures::initialized_ = false;
38 #endif
39
40 void HostCPUFeatures::InitOnce() {
41 CpuInfo::InitOnce();
42 hardware_ = CpuInfo::GetCpuModel();
43 sse4_1_supported_ =
44 CpuInfo::FieldContains(kCpuInfoFeatures, "sse4_1") ||
45 CpuInfo::FieldContains(kCpuInfoFeatures, "sse4.1");
46
47 #if defined(DEBUG)
48 initialized_ = true;
49 #endif
50 }
51
52
53 void HostCPUFeatures::Cleanup() {
54 DEBUG_ASSERT(initialized_);
55 #if defined(DEBUG)
56 initialized_ = false;
57 #endif
58 ASSERT(hardware_ != NULL);
59 delete[] hardware_;
60 hardware_ = NULL;
61 CpuInfo::Cleanup();
62 }
63
27 } // namespace dart 64 } // namespace dart
28 65
29 #endif // defined TARGET_ARCH_X64 66 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/cpu_x64.h ('k') | runtime/vm/cpuid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698