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

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

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 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
« no previous file with comments | « runtime/vm/cpu.h ('k') | runtime/vm/cpu_arm64.cc » ('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 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/cpu.h" 8 #include "vm/cpu.h"
9 #include "vm/cpu_arm.h" 9 #include "vm/cpu_arm.h"
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 char* end = reinterpret_cast<char*>(start + size); 110 char* end = reinterpret_cast<char*>(start + size);
111 ::__clear_cache(beg, end); 111 ::__clear_cache(beg, end);
112 #elif defined(ANDROID) 112 #elif defined(ANDROID)
113 cacheflush(start, start + size, 0); 113 cacheflush(start, start + size, 0);
114 #else 114 #else
115 #error FlushICache only tested/supported on Linux and Android 115 #error FlushICache only tested/supported on Linux and Android
116 #endif 116 #endif
117 #endif 117 #endif
118 } 118 }
119 119
120
121 const char* CPU::Id() { 120 const char* CPU::Id() {
122 return 121 return
123 #if defined(USING_SIMULATOR) 122 #if defined(USING_SIMULATOR)
124 "sim" 123 "sim"
125 #endif // defined(USING_SIMULATOR) 124 #endif // defined(USING_SIMULATOR)
126 "arm"; 125 "arm";
127 } 126 }
128 127
129
130 bool HostCPUFeatures::integer_division_supported_ = false; 128 bool HostCPUFeatures::integer_division_supported_ = false;
131 bool HostCPUFeatures::vfp_supported_ = false; 129 bool HostCPUFeatures::vfp_supported_ = false;
132 bool HostCPUFeatures::neon_supported_ = false; 130 bool HostCPUFeatures::neon_supported_ = false;
133 bool HostCPUFeatures::hardfp_supported_ = false; 131 bool HostCPUFeatures::hardfp_supported_ = false;
134 const char* HostCPUFeatures::hardware_ = NULL; 132 const char* HostCPUFeatures::hardware_ = NULL;
135 ARMVersion HostCPUFeatures::arm_version_ = ARMvUnknown; 133 ARMVersion HostCPUFeatures::arm_version_ = ARMvUnknown;
136 intptr_t HostCPUFeatures::store_pc_read_offset_ = 8; 134 intptr_t HostCPUFeatures::store_pc_read_offset_ = 8;
137 #if defined(DEBUG) 135 #if defined(DEBUG)
138 bool HostCPUFeatures::initialized_ = false; 136 bool HostCPUFeatures::initialized_ = false;
139 #endif 137 #endif
140 138
141
142 #if !defined(USING_SIMULATOR) 139 #if !defined(USING_SIMULATOR)
143 #if HOST_OS_IOS 140 #if HOST_OS_IOS
144 void HostCPUFeatures::InitOnce() { 141 void HostCPUFeatures::InitOnce() {
145 // TODO(24743): Actually check the CPU features and fail if we're missing 142 // TODO(24743): Actually check the CPU features and fail if we're missing
146 // something assumed in a precompiled snapshot. 143 // something assumed in a precompiled snapshot.
147 hardware_ = ""; 144 hardware_ = "";
148 // When the VM is targetted to ARMv7, pretend that the CPU is ARMv7 even if 145 // When the VM is targetted to ARMv7, pretend that the CPU is ARMv7 even if
149 // the CPU is actually AArch64. 146 // the CPU is actually AArch64.
150 arm_version_ = ARMv7; 147 arm_version_ = ARMv7;
151 // Always assume we have floating point unit since we don't support ARMv6 in 148 // Always assume we have floating point unit since we don't support ARMv6 in
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 274
278 integer_division_supported_ = FLAG_use_integer_division; 275 integer_division_supported_ = FLAG_use_integer_division;
279 vfp_supported_ = FLAG_use_vfp; 276 vfp_supported_ = FLAG_use_vfp;
280 neon_supported_ = FLAG_use_vfp && FLAG_use_neon; 277 neon_supported_ = FLAG_use_vfp && FLAG_use_neon;
281 hardfp_supported_ = FLAG_sim_use_hardfp; 278 hardfp_supported_ = FLAG_sim_use_hardfp;
282 #if defined(DEBUG) 279 #if defined(DEBUG)
283 initialized_ = true; 280 initialized_ = true;
284 #endif 281 #endif
285 } 282 }
286 283
287
288 void HostCPUFeatures::Cleanup() { 284 void HostCPUFeatures::Cleanup() {
289 DEBUG_ASSERT(initialized_); 285 DEBUG_ASSERT(initialized_);
290 #if defined(DEBUG) 286 #if defined(DEBUG)
291 initialized_ = false; 287 initialized_ = false;
292 #endif 288 #endif
293 ASSERT(hardware_ != NULL); 289 ASSERT(hardware_ != NULL);
294 free(const_cast<char*>(hardware_)); 290 free(const_cast<char*>(hardware_));
295 hardware_ = NULL; 291 hardware_ = NULL;
296 CpuInfo::Cleanup(); 292 CpuInfo::Cleanup();
297 } 293 }
298 #endif // !defined(USING_SIMULATOR) 294 #endif // !defined(USING_SIMULATOR)
299 295
300 } // namespace dart 296 } // namespace dart
301 297
302 #endif // defined TARGET_ARCH_ARM 298 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/cpu.h ('k') | runtime/vm/cpu_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698