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_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <android/log.h> // NOLINT | 10 #include <android/log.h> // NOLINT |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 // TODO(5411554): Allow overriding default stack alignment for | 213 // TODO(5411554): Allow overriding default stack alignment for |
214 // testing purposes. | 214 // testing purposes. |
215 // Flags::DebugIsInt("stackalign", &alignment); | 215 // Flags::DebugIsInt("stackalign", &alignment); |
216 ASSERT(Utils::IsPowerOfTwo(alignment)); | 216 ASSERT(Utils::IsPowerOfTwo(alignment)); |
217 ASSERT(alignment >= kMinimumAlignment); | 217 ASSERT(alignment >= kMinimumAlignment); |
218 return alignment; | 218 return alignment; |
219 } | 219 } |
220 | 220 |
221 | 221 |
222 intptr_t OS::PreferredCodeAlignment() { | 222 intptr_t OS::PreferredCodeAlignment() { |
223 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ | 223 #if defined(TARGET_ARCH_IA32) || \ |
224 defined(TARGET_ARCH_ARM64) | 224 defined(TARGET_ARCH_X64) || \ |
225 const int kMinimumAlignment = 16; | 225 defined(TARGET_ARCH_ARM64) || \ |
226 #elif defined(TARGET_ARCH_ARM) | 226 defined(TARGET_ARCH_DBC) |
227 const int kMinimumAlignment = 16; | 227 const int kMinimumAlignment = 32; |
228 #elif defined(TARGET_ARCH_DBC) | 228 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) |
229 const int kMinimumAlignment = 16; | 229 const int kMinimumAlignment = 16; |
230 #else | 230 #else |
231 #error Unsupported architecture. | 231 #error Unsupported architecture. |
232 #endif | 232 #endif |
233 intptr_t alignment = kMinimumAlignment; | 233 intptr_t alignment = kMinimumAlignment; |
234 // TODO(5411554): Allow overriding default code alignment for | 234 // TODO(5411554): Allow overriding default code alignment for |
235 // testing purposes. | 235 // testing purposes. |
236 // Flags::DebugIsInt("codealign", &alignment); | 236 // Flags::DebugIsInt("codealign", &alignment); |
237 ASSERT(Utils::IsPowerOfTwo(alignment)); | 237 ASSERT(Utils::IsPowerOfTwo(alignment)); |
238 ASSERT(alignment >= kMinimumAlignment); | 238 ASSERT(alignment >= kMinimumAlignment); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 | 443 |
444 | 444 |
445 void OS::Exit(int code) { | 445 void OS::Exit(int code) { |
446 exit(code); | 446 exit(code); |
447 } | 447 } |
448 | 448 |
449 } // namespace dart | 449 } // namespace dart |
450 | 450 |
451 #endif // defined(TARGET_OS_ANDROID) | 451 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |