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(HOST_OS_MACOS) | 6 #if defined(HOST_OS_MACOS) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // Function Call Guide". | 188 // Function Call Guide". |
189 return 16; | 189 return 16; |
190 #endif // HOST_OS_IOS | 190 #endif // HOST_OS_IOS |
191 } | 191 } |
192 | 192 |
193 | 193 |
194 intptr_t OS::PreferredCodeAlignment() { | 194 intptr_t OS::PreferredCodeAlignment() { |
195 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ | 195 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ |
196 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) | 196 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) |
197 const int kMinimumAlignment = 32; | 197 const int kMinimumAlignment = 32; |
198 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) | 198 #elif defined(TARGET_ARCH_ARM) |
199 const int kMinimumAlignment = 16; | 199 const int kMinimumAlignment = 16; |
200 #else | 200 #else |
201 #error Unsupported architecture. | 201 #error Unsupported architecture. |
202 #endif | 202 #endif |
203 intptr_t alignment = kMinimumAlignment; | 203 intptr_t alignment = kMinimumAlignment; |
204 // TODO(5411554): Allow overriding default code alignment for | 204 // TODO(5411554): Allow overriding default code alignment for |
205 // testing purposes. | 205 // testing purposes. |
206 // Flags::DebugIsInt("codealign", &alignment); | 206 // Flags::DebugIsInt("codealign", &alignment); |
207 ASSERT(Utils::IsPowerOfTwo(alignment)); | 207 ASSERT(Utils::IsPowerOfTwo(alignment)); |
208 ASSERT(alignment >= kMinimumAlignment); | 208 ASSERT(alignment >= kMinimumAlignment); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 } | 449 } |
450 | 450 |
451 | 451 |
452 void OS::Exit(int code) { | 452 void OS::Exit(int code) { |
453 exit(code); | 453 exit(code); |
454 } | 454 } |
455 | 455 |
456 } // namespace dart | 456 } // namespace dart |
457 | 457 |
458 #endif // defined(HOST_OS_MACOS) | 458 #endif // defined(HOST_OS_MACOS) |
OLD | NEW |