| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "vm/cpuinfo.h" | 8 #include "vm/cpuinfo.h" |
| 9 #include "vm/cpuid.h" | 9 #include "vm/cpuid.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 void CpuInfo::InitOnce() { | 22 void CpuInfo::InitOnce() { |
| 23 method_ = kCpuInfoCpuId; | 23 method_ = kCpuInfoCpuId; |
| 24 | 24 |
| 25 // Initialize the CpuId information. | 25 // Initialize the CpuId information. |
| 26 CpuId::InitOnce(); | 26 CpuId::InitOnce(); |
| 27 | 27 |
| 28 fields_[kCpuInfoProcessor] = "Processor"; | 28 fields_[kCpuInfoProcessor] = "Processor"; |
| 29 fields_[kCpuInfoModel] = "Hardware"; | 29 fields_[kCpuInfoModel] = "Hardware"; |
| 30 fields_[kCpuInfoHardware] = "Hardware"; | 30 fields_[kCpuInfoHardware] = "Hardware"; |
| 31 fields_[kCpuInfoFeatures] = "Features"; | 31 fields_[kCpuInfoFeatures] = "Features"; |
| 32 fields_[kCpuInfoArchitecture] = NULL; |
| 32 } | 33 } |
| 33 | 34 |
| 34 | 35 |
| 35 void CpuInfo::Cleanup() { | 36 void CpuInfo::Cleanup() { |
| 36 CpuId::Cleanup(); | 37 CpuId::Cleanup(); |
| 37 } | 38 } |
| 38 | 39 |
| 39 | 40 |
| 40 bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) { | 41 bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) { |
| 41 ASSERT(method_ != kCpuInfoDefault); | 42 ASSERT(method_ != kCpuInfoDefault); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 53 ASSERT(method_ != kCpuInfoDefault); | 54 ASSERT(method_ != kCpuInfoDefault); |
| 54 return (strcmp(field, fields_[kCpuInfoProcessor]) == 0) || | 55 return (strcmp(field, fields_[kCpuInfoProcessor]) == 0) || |
| 55 (strcmp(field, fields_[kCpuInfoModel]) == 0) || | 56 (strcmp(field, fields_[kCpuInfoModel]) == 0) || |
| 56 (strcmp(field, fields_[kCpuInfoHardware]) == 0) || | 57 (strcmp(field, fields_[kCpuInfoHardware]) == 0) || |
| 57 (strcmp(field, fields_[kCpuInfoFeatures]) == 0); | 58 (strcmp(field, fields_[kCpuInfoFeatures]) == 0); |
| 58 } | 59 } |
| 59 | 60 |
| 60 } // namespace dart | 61 } // namespace dart |
| 61 | 62 |
| 62 #endif // defined(TARGET_OS_WINDOWS) | 63 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |