From 69fe1ff2815899c968de99724544032817881c39 Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Thu, 25 Jul 2013 09:49:28 +0000 Subject: [PATCH] Don't duplicate OS::ActivationFrameAlignment() for every POSIX platform. R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/20283002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15876 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/platform-cygwin.cc | 7 ------- src/platform-freebsd.cc | 6 ------ src/platform-linux.cc | 14 -------------- src/platform-macos.cc | 7 ------- src/platform-openbsd.cc | 7 ------- src/platform-posix.cc | 18 ++++++++++++++++++ src/platform-solaris.cc | 6 ------ 7 files changed, 18 insertions(+), 47 deletions(-) diff --git a/src/platform-cygwin.cc b/src/platform-cygwin.cc index 59cc1a2..4c7b017 100644 --- a/src/platform-cygwin.cc +++ b/src/platform-cygwin.cc @@ -55,13 +55,6 @@ namespace internal { static Mutex* limit_mutex = NULL; -int OS::ActivationFrameAlignment() { - // With gcc 4.4 the tree vectorization optimizer can generate code - // that requires 16 byte alignment such as movdqa on x86. - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc index 0bf2375..e0917fa 100644 --- a/src/platform-freebsd.cc +++ b/src/platform-freebsd.cc @@ -66,12 +66,6 @@ namespace internal { static Mutex* limit_mutex = NULL; -int OS::ActivationFrameAlignment() { - // 16 byte alignment on FreeBSD - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); diff --git a/src/platform-linux.cc b/src/platform-linux.cc index fb784d1..5c252bb 100644 --- a/src/platform-linux.cc +++ b/src/platform-linux.cc @@ -308,20 +308,6 @@ bool OS::MipsCpuHasFeature(CpuFeature feature) { #endif // def __mips__ -int OS::ActivationFrameAlignment() { -#if V8_TARGET_ARCH_ARM - // On EABI ARM targets this is required for fp correctness in the - // runtime system. - return 8; -#elif V8_TARGET_ARCH_MIPS - return 8; -#endif - // With gcc 4.4 the tree vectorization optimizer can generate code - // that requires 16 byte alignment such as movdqa on x86. - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); diff --git a/src/platform-macos.cc b/src/platform-macos.cc index 10aef80..6135cd1 100644 --- a/src/platform-macos.cc +++ b/src/platform-macos.cc @@ -231,13 +231,6 @@ void OS::SignalCodeMovingGC() { } -int OS::ActivationFrameAlignment() { - // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI - // Function Call Guide". - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); diff --git a/src/platform-openbsd.cc b/src/platform-openbsd.cc index b4a7a4c..e591601 100644 --- a/src/platform-openbsd.cc +++ b/src/platform-openbsd.cc @@ -64,13 +64,6 @@ namespace internal { static Mutex* limit_mutex = NULL; -int OS::ActivationFrameAlignment() { - // With gcc 4.4 the tree vectorization optimizer can generate code - // that requires 16 byte alignment such as movdqa on x86. - return 16; -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); diff --git a/src/platform-posix.cc b/src/platform-posix.cc index cd2b9b9..13b819b 100644 --- a/src/platform-posix.cc +++ b/src/platform-posix.cc @@ -101,6 +101,24 @@ intptr_t OS::MaxVirtualMemory() { } +int OS::ActivationFrameAlignment() { +#if V8_TARGET_ARCH_ARM + // On EABI ARM targets this is required for fp correctness in the + // runtime system. + return 8; +#elif V8_TARGET_ARCH_MIPS + return 8; +#else + // Otherwise we just assume 16 byte alignment, i.e.: + // - With gcc 4.4 the tree vectorization optimizer can generate code + // that requires 16 byte alignment such as movdqa on x86. + // - Mac OS X and Solaris (64-bit) activation frames must be 16 byte-aligned; + // see "Mac OS X ABI Function Call Guide" + return 16; +#endif +} + + intptr_t OS::CommitPageSize() { static intptr_t page_size = getpagesize(); return page_size; diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc index 46fff60..b1d88af 100644 --- a/src/platform-solaris.cc +++ b/src/platform-solaris.cc @@ -84,12 +84,6 @@ namespace internal { static Mutex* limit_mutex = NULL; -int OS::ActivationFrameAlignment() { - // GCC generates code that requires 16 byte alignment such as movdqa. - return Max(STACK_ALIGN, 16); -} - - const char* OS::LocalTimezone(double time) { if (std::isnan(time)) return ""; time_t tv = static_cast(floor(time/msPerSecond)); -- 2.7.4