| 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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 // testing purposes. | 351 // testing purposes. |
| 352 // Flags::DebugIsInt("stackalign", &alignment); | 352 // Flags::DebugIsInt("stackalign", &alignment); |
| 353 ASSERT(Utils::IsPowerOfTwo(alignment)); | 353 ASSERT(Utils::IsPowerOfTwo(alignment)); |
| 354 ASSERT(alignment >= kMinimumAlignment); | 354 ASSERT(alignment >= kMinimumAlignment); |
| 355 return alignment; | 355 return alignment; |
| 356 } | 356 } |
| 357 | 357 |
| 358 | 358 |
| 359 word OS::PreferredCodeAlignment() { | 359 word OS::PreferredCodeAlignment() { |
| 360 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 360 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
| 361 const int kMinimumAlignment = 16; | 361 const int kMinimumAlignment = 32; |
| 362 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) | 362 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) |
| 363 // TODO(regis): Verify alignment constraints on MIPS. | 363 // TODO(regis): Verify alignment constraints on MIPS. |
| 364 const int kMinimumAlignment = 16; | 364 const int kMinimumAlignment = 16; |
| 365 #else | 365 #else |
| 366 #error Unsupported architecture. | 366 #error Unsupported architecture. |
| 367 #endif | 367 #endif |
| 368 word alignment = kMinimumAlignment; | 368 word alignment = kMinimumAlignment; |
| 369 // TODO(5411554): Allow overriding default code alignment for | 369 // TODO(5411554): Allow overriding default code alignment for |
| 370 // testing purposes. | 370 // testing purposes. |
| 371 // Flags::DebugIsInt("codealign", &alignment); | 371 // Flags::DebugIsInt("codealign", &alignment); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 } | 515 } |
| 516 | 516 |
| 517 | 517 |
| 518 void OS::Exit(int code) { | 518 void OS::Exit(int code) { |
| 519 exit(code); | 519 exit(code); |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace dart | 522 } // namespace dart |
| 523 | 523 |
| 524 #endif // defined(TARGET_OS_LINUX) | 524 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |