OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
9 #include "vm/cpu_ia32.h" | 9 #include "vm/cpu_ia32.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 const char* HostCPUFeatures::hardware_ = NULL; | 34 const char* HostCPUFeatures::hardware_ = NULL; |
35 #if defined(DEBUG) | 35 #if defined(DEBUG) |
36 bool HostCPUFeatures::initialized_ = false; | 36 bool HostCPUFeatures::initialized_ = false; |
37 #endif | 37 #endif |
38 | 38 |
39 void HostCPUFeatures::InitOnce() { | 39 void HostCPUFeatures::InitOnce() { |
40 CpuInfo::InitOnce(); | 40 CpuInfo::InitOnce(); |
41 | 41 |
42 hardware_ = CpuInfo::GetCpuModel(); | 42 hardware_ = CpuInfo::GetCpuModel(); |
43 sse2_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "sse2"); | 43 sse2_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "sse2"); |
44 sse4_1_supported_ = | 44 sse4_1_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "sse4_1") || |
45 CpuInfo::FieldContains(kCpuInfoFeatures, "sse4_1") || | 45 CpuInfo::FieldContains(kCpuInfoFeatures, "sse4.1"); |
46 CpuInfo::FieldContains(kCpuInfoFeatures, "sse4.1"); | |
47 | 46 |
48 #if defined(DEBUG) | 47 #if defined(DEBUG) |
49 initialized_ = true; | 48 initialized_ = true; |
50 #endif | 49 #endif |
51 } | 50 } |
52 | 51 |
53 | 52 |
54 void HostCPUFeatures::Cleanup() { | 53 void HostCPUFeatures::Cleanup() { |
55 DEBUG_ASSERT(initialized_); | 54 DEBUG_ASSERT(initialized_); |
56 #if defined(DEBUG) | 55 #if defined(DEBUG) |
57 initialized_ = false; | 56 initialized_ = false; |
58 #endif | 57 #endif |
59 ASSERT(hardware_ != NULL); | 58 ASSERT(hardware_ != NULL); |
60 free(const_cast<char*>(hardware_)); | 59 free(const_cast<char*>(hardware_)); |
61 hardware_ = NULL; | 60 hardware_ = NULL; |
62 CpuInfo::Cleanup(); | 61 CpuInfo::Cleanup(); |
63 } | 62 } |
64 | 63 |
65 } // namespace dart | 64 } // namespace dart |
66 | 65 |
67 #endif // defined TARGET_ARCH_IA32 | 66 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |