Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/cpuinfo.h" | 10 #include "vm/cpuinfo.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 bool HostCPUFeatures::hardfp_supported_ = false; | 121 bool HostCPUFeatures::hardfp_supported_ = false; |
| 122 const char* HostCPUFeatures::hardware_ = NULL; | 122 const char* HostCPUFeatures::hardware_ = NULL; |
| 123 ARMVersion HostCPUFeatures::arm_version_ = ARMvUnknown; | 123 ARMVersion HostCPUFeatures::arm_version_ = ARMvUnknown; |
| 124 intptr_t HostCPUFeatures::store_pc_read_offset_ = 8; | 124 intptr_t HostCPUFeatures::store_pc_read_offset_ = 8; |
| 125 #if defined(DEBUG) | 125 #if defined(DEBUG) |
| 126 bool HostCPUFeatures::initialized_ = false; | 126 bool HostCPUFeatures::initialized_ = false; |
| 127 #endif | 127 #endif |
| 128 | 128 |
| 129 | 129 |
| 130 #if !defined(USING_SIMULATOR) | 130 #if !defined(USING_SIMULATOR) |
| 131 #if TARGET_OS_IOS | |
| 132 void HostCPUFeatures::InitOnce() { | |
|
rmacnak
2015/10/27 20:44:22
TODO(24743): Actually check the CPU features and f
Chinmay
2015/10/27 20:49:47
ack
| |
| 133 hardware_ = ""; | |
| 134 // When the VM is targetted to ARMv7, pretend that the CPU is ARMv7 even if | |
| 135 // the CPU is actuall AArch64. | |
| 136 arm_version_ = ARMv7; | |
| 137 // Always assume we have floating point unit since we dont support ARMv6 in | |
| 138 // this path. | |
| 139 vfp_supported_ = FLAG_use_vfp; | |
| 140 integer_division_supported_ = FLAG_use_integer_division; | |
| 141 neon_supported_ = FLAG_use_neon; | |
| 142 hardfp_supported_ = true; | |
| 143 #if defined(DEBUG) | |
| 144 initialized_ = true; | |
| 145 #endif | |
| 146 } | |
| 147 #else // TARGET_OS_IOS | |
| 131 void HostCPUFeatures::InitOnce() { | 148 void HostCPUFeatures::InitOnce() { |
| 132 bool is_arm64 = false; | 149 bool is_arm64 = false; |
| 133 CpuInfo::InitOnce(); | 150 CpuInfo::InitOnce(); |
| 134 hardware_ = CpuInfo::GetCpuModel(); | 151 hardware_ = CpuInfo::GetCpuModel(); |
| 135 | 152 |
| 136 // Check for ARMv5TE, ARMv6, ARMv7, or aarch64. | 153 // Check for ARMv5TE, ARMv6, ARMv7, or aarch64. |
| 137 // It can be in either the Processor or Model information fields. | 154 // It can be in either the Processor or Model information fields. |
| 138 if (CpuInfo::FieldContains(kCpuInfoProcessor, "aarch64") || | 155 if (CpuInfo::FieldContains(kCpuInfoProcessor, "aarch64") || |
| 139 CpuInfo::FieldContains(kCpuInfoModel, "aarch64")) { | 156 CpuInfo::FieldContains(kCpuInfoModel, "aarch64")) { |
| 140 // pretend that this arm64 cpu is really an ARMv7 | 157 // pretend that this arm64 cpu is really an ARMv7 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 #if defined(__ARM_PCS_VFP) | 212 #if defined(__ARM_PCS_VFP) |
| 196 hardfp_supported_ = true; | 213 hardfp_supported_ = true; |
| 197 #else | 214 #else |
| 198 hardfp_supported_ = false; | 215 hardfp_supported_ = false; |
| 199 #endif | 216 #endif |
| 200 | 217 |
| 201 #if defined(DEBUG) | 218 #if defined(DEBUG) |
| 202 initialized_ = true; | 219 initialized_ = true; |
| 203 #endif | 220 #endif |
| 204 } | 221 } |
| 205 | 222 #endif // TARGET_OS_IOS |
| 206 | 223 |
| 207 void HostCPUFeatures::Cleanup() { | 224 void HostCPUFeatures::Cleanup() { |
| 208 DEBUG_ASSERT(initialized_); | 225 DEBUG_ASSERT(initialized_); |
| 209 #if defined(DEBUG) | 226 #if defined(DEBUG) |
| 210 initialized_ = false; | 227 initialized_ = false; |
| 211 #endif | 228 #endif |
| 212 ASSERT(hardware_ != NULL); | 229 ASSERT(hardware_ != NULL); |
| 213 free(const_cast<char*>(hardware_)); | 230 free(const_cast<char*>(hardware_)); |
| 214 hardware_ = NULL; | 231 hardware_ = NULL; |
| 215 CpuInfo::Cleanup(); | 232 CpuInfo::Cleanup(); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 245 ASSERT(hardware_ != NULL); | 262 ASSERT(hardware_ != NULL); |
| 246 free(const_cast<char*>(hardware_)); | 263 free(const_cast<char*>(hardware_)); |
| 247 hardware_ = NULL; | 264 hardware_ = NULL; |
| 248 CpuInfo::Cleanup(); | 265 CpuInfo::Cleanup(); |
| 249 } | 266 } |
| 250 #endif // !defined(USING_SIMULATOR) | 267 #endif // !defined(USING_SIMULATOR) |
| 251 | 268 |
| 252 } // namespace dart | 269 } // namespace dart |
| 253 | 270 |
| 254 #endif // defined TARGET_ARCH_ARM | 271 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |