Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Unified Diff: runtime/vm/os_macos.cc

Issue 1982613003: Don't assume we want the iOS ABI if running simarm on Mac and the EABI otherwise. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/os_android.cc ('k') | runtime/vm/simulator_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_macos.cc
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
index 6d2d02ac1ffdb59bd3233aa9023d7d43e465a786..e231e5ccbc100f16f368468b12534c571d013a16 100644
--- a/runtime/vm/os_macos.cc
+++ b/runtime/vm/os_macos.cc
@@ -204,8 +204,24 @@ intptr_t OS::ActivationFrameAlignment() {
intptr_t OS::PreferredCodeAlignment() {
- ASSERT(32 <= OS::kMaxPreferredCodeAlignment);
- return 32;
+#if defined(TARGET_ARCH_IA32) || \
+ defined(TARGET_ARCH_X64) || \
+ defined(TARGET_ARCH_ARM64) || \
+ defined(TARGET_ARCH_DBC)
+ const int kMinimumAlignment = 32;
+#elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
+ const int kMinimumAlignment = 16;
+#else
+#error Unsupported architecture.
+#endif
+ intptr_t alignment = kMinimumAlignment;
+ // TODO(5411554): Allow overriding default code alignment for
+ // testing purposes.
+ // Flags::DebugIsInt("codealign", &alignment);
+ ASSERT(Utils::IsPowerOfTwo(alignment));
+ ASSERT(alignment >= kMinimumAlignment);
+ ASSERT(alignment <= OS::kMaxPreferredCodeAlignment);
+ return alignment;
}
« no previous file with comments | « runtime/vm/os_android.cc ('k') | runtime/vm/simulator_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698