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

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

Issue 2665143004: Fix various alignments to make ARM precompilation work on Windows. (Closed)
Patch Set: rearrange if-defines Created 3 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
« no previous file with comments | « no previous file | no next file » | 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_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <malloc.h> // NOLINT 10 #include <malloc.h> // NOLINT
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 184
185 int64_t OS::GetCurrentThreadCPUMicros() { 185 int64_t OS::GetCurrentThreadCPUMicros() {
186 // TODO(johnmccutchan): Implement. See base/time_win.cc for details. 186 // TODO(johnmccutchan): Implement. See base/time_win.cc for details.
187 return -1; 187 return -1;
188 } 188 }
189 189
190 190
191 intptr_t OS::ActivationFrameAlignment() { 191 intptr_t OS::ActivationFrameAlignment() {
192 #ifdef _WIN64 192 #if defined(TARGET_ARCH_ARM64)
193 return 16;
194 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
195 return 8;
196 #elif defined(_WIN64)
193 // Windows 64-bit ABI requires the stack to be 16-byte aligned. 197 // Windows 64-bit ABI requires the stack to be 16-byte aligned.
194 return 16; 198 return 16;
195 #else 199 #else
196 // No requirements on Win32. 200 // No requirements on Win32.
197 return 1; 201 return 1;
198 #endif 202 #endif
199 } 203 }
200 204
201 205
202 intptr_t OS::PreferredCodeAlignment() { 206 intptr_t OS::PreferredCodeAlignment() {
203 ASSERT(32 <= OS::kMaxPreferredCodeAlignment); 207 ASSERT(32 <= OS::kMaxPreferredCodeAlignment);
208 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \
209 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC)
204 return 32; 210 return 32;
211 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
212 return 16;
213 #else
214 #error Unsupported architecture.
215 #endif
205 } 216 }
206 217
207 218
208 bool OS::AllowStackFrameIteratorFromAnotherThread() { 219 bool OS::AllowStackFrameIteratorFromAnotherThread() {
209 return true; 220 return true;
210 } 221 }
211 222
212 223
213 int OS::NumberOfAvailableProcessors() { 224 int OS::NumberOfAvailableProcessors() {
214 SYSTEM_INFO info; 225 SYSTEM_INFO info;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // TODO(zra): Remove once VM shuts down cleanly. 445 // TODO(zra): Remove once VM shuts down cleanly.
435 private_flag_windows_run_tls_destructors = false; 446 private_flag_windows_run_tls_destructors = false;
436 // On Windows we use ExitProcess so that threads can't clobber the exit_code. 447 // On Windows we use ExitProcess so that threads can't clobber the exit_code.
437 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870 448 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870
438 ::ExitProcess(code); 449 ::ExitProcess(code);
439 } 450 }
440 451
441 } // namespace dart 452 } // namespace dart
442 453
443 #endif // defined(TARGET_OS_WINDOWS) 454 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698