OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_FUCHSIA) | 6 #if defined(HOST_OS_FUCHSIA) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <errno.h> | 10 #include <errno.h> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 ASSERT(Utils::IsPowerOfTwo(alignment)); | 123 ASSERT(Utils::IsPowerOfTwo(alignment)); |
124 ASSERT(alignment >= kMinimumAlignment); | 124 ASSERT(alignment >= kMinimumAlignment); |
125 return alignment; | 125 return alignment; |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 intptr_t OS::PreferredCodeAlignment() { | 129 intptr_t OS::PreferredCodeAlignment() { |
130 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ | 130 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ |
131 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) | 131 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) |
132 const int kMinimumAlignment = 32; | 132 const int kMinimumAlignment = 32; |
133 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) | 133 #elif defined(TARGET_ARCH_ARM) |
134 const int kMinimumAlignment = 16; | 134 const int kMinimumAlignment = 16; |
135 #else | 135 #else |
136 #error Unsupported architecture. | 136 #error Unsupported architecture. |
137 #endif | 137 #endif |
138 intptr_t alignment = kMinimumAlignment; | 138 intptr_t alignment = kMinimumAlignment; |
139 // TODO(5411554): Allow overriding default code alignment for | 139 // TODO(5411554): Allow overriding default code alignment for |
140 // testing purposes. | 140 // testing purposes. |
141 // Flags::DebugIsInt("codealign", &alignment); | 141 // Flags::DebugIsInt("codealign", &alignment); |
142 ASSERT(Utils::IsPowerOfTwo(alignment)); | 142 ASSERT(Utils::IsPowerOfTwo(alignment)); |
143 ASSERT(alignment >= kMinimumAlignment); | 143 ASSERT(alignment >= kMinimumAlignment); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 311 } |
312 | 312 |
313 | 313 |
314 void OS::Exit(int code) { | 314 void OS::Exit(int code) { |
315 UNIMPLEMENTED(); | 315 UNIMPLEMENTED(); |
316 } | 316 } |
317 | 317 |
318 } // namespace dart | 318 } // namespace dart |
319 | 319 |
320 #endif // defined(HOST_OS_FUCHSIA) | 320 #endif // defined(HOST_OS_FUCHSIA) |
OLD | NEW |