| 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_LINUX) | 6 #if defined(HOST_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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return result; | 191 return result; |
| 192 } | 192 } |
| 193 | 193 |
| 194 | 194 |
| 195 // TODO(5411554): May need to hoist these architecture dependent code | 195 // TODO(5411554): May need to hoist these architecture dependent code |
| 196 // into a architecture specific file e.g: os_ia32_linux.cc | 196 // into a architecture specific file e.g: os_ia32_linux.cc |
| 197 intptr_t OS::ActivationFrameAlignment() { | 197 intptr_t OS::ActivationFrameAlignment() { |
| 198 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ | 198 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ |
| 199 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) | 199 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) |
| 200 const int kMinimumAlignment = 16; | 200 const int kMinimumAlignment = 16; |
| 201 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) | 201 #elif defined(TARGET_ARCH_ARM) |
| 202 const int kMinimumAlignment = 8; | 202 const int kMinimumAlignment = 8; |
| 203 #else | 203 #else |
| 204 #error Unsupported architecture. | 204 #error Unsupported architecture. |
| 205 #endif | 205 #endif |
| 206 intptr_t alignment = kMinimumAlignment; | 206 intptr_t alignment = kMinimumAlignment; |
| 207 // TODO(5411554): Allow overriding default stack alignment for | 207 // TODO(5411554): Allow overriding default stack alignment for |
| 208 // testing purposes. | 208 // testing purposes. |
| 209 // Flags::DebugIsInt("stackalign", &alignment); | 209 // Flags::DebugIsInt("stackalign", &alignment); |
| 210 ASSERT(Utils::IsPowerOfTwo(alignment)); | 210 ASSERT(Utils::IsPowerOfTwo(alignment)); |
| 211 ASSERT(alignment >= kMinimumAlignment); | 211 ASSERT(alignment >= kMinimumAlignment); |
| 212 return alignment; | 212 return alignment; |
| 213 } | 213 } |
| 214 | 214 |
| 215 | 215 |
| 216 intptr_t OS::PreferredCodeAlignment() { | 216 intptr_t OS::PreferredCodeAlignment() { |
| 217 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ | 217 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ |
| 218 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) | 218 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) |
| 219 const int kMinimumAlignment = 32; | 219 const int kMinimumAlignment = 32; |
| 220 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) | 220 #elif defined(TARGET_ARCH_ARM) |
| 221 const int kMinimumAlignment = 16; | 221 const int kMinimumAlignment = 16; |
| 222 #else | 222 #else |
| 223 #error Unsupported architecture. | 223 #error Unsupported architecture. |
| 224 #endif | 224 #endif |
| 225 intptr_t alignment = kMinimumAlignment; | 225 intptr_t alignment = kMinimumAlignment; |
| 226 // TODO(5411554): Allow overriding default code alignment for | 226 // TODO(5411554): Allow overriding default code alignment for |
| 227 // testing purposes. | 227 // testing purposes. |
| 228 // Flags::DebugIsInt("codealign", &alignment); | 228 // Flags::DebugIsInt("codealign", &alignment); |
| 229 ASSERT(Utils::IsPowerOfTwo(alignment)); | 229 ASSERT(Utils::IsPowerOfTwo(alignment)); |
| 230 ASSERT(alignment >= kMinimumAlignment); | 230 ASSERT(alignment >= kMinimumAlignment); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 417 } |
| 418 | 418 |
| 419 | 419 |
| 420 void OS::Exit(int code) { | 420 void OS::Exit(int code) { |
| 421 exit(code); | 421 exit(code); |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace dart | 424 } // namespace dart |
| 425 | 425 |
| 426 #endif // defined(HOST_OS_LINUX) | 426 #endif // defined(HOST_OS_LINUX) |
| OLD | NEW |