Reviewers: Sven Panne,
Description:
Don't duplicate OS::CpuFeaturesImpliedByPlatform for every POSIX platform.
[email protected]
Please review this at https://codereview.chromium.org/20179004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/platform-cygwin.cc
M src/platform-freebsd.cc
M src/platform-linux.cc
M src/platform-macos.cc
M src/platform-openbsd.cc
M src/platform-posix.cc
M src/platform-solaris.cc
Index: src/platform-cygwin.cc
diff --git a/src/platform-cygwin.cc b/src/platform-cygwin.cc
index
6be908e22454fc1f8551e253d91ca17ba8142479..59cc1a2d50e3c3e73c8132ed25c0e4635692a0ed
100644
--- a/src/platform-cygwin.cc
+++ b/src/platform-cygwin.cc
@@ -55,11 +55,6 @@ namespace internal {
static Mutex* limit_mutex = NULL;
-uint64_t OS::CpuFeaturesImpliedByPlatform() {
- return 0; // Nothing special about Cygwin.
-}
-
-
int OS::ActivationFrameAlignment() {
// With gcc 4.4 the tree vectorization optimizer can generate code
// that requires 16 byte alignment such as movdqa on x86.
Index: src/platform-freebsd.cc
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc
index
e403d6d1a03ed68e249a5638cc9dbd9ccb7f5ef5..0bf23757475d31e1737499bf2c1abc6f695d4377
100644
--- a/src/platform-freebsd.cc
+++ b/src/platform-freebsd.cc
@@ -66,11 +66,6 @@ namespace internal {
static Mutex* limit_mutex = NULL;
-uint64_t OS::CpuFeaturesImpliedByPlatform() {
- return 0; // FreeBSD runs on anything.
-}
-
-
int OS::ActivationFrameAlignment() {
// 16 byte alignment on FreeBSD
return 16;
Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index
febd668f319396fdc25066eb047584fb70ad1c27..fb784d1f53d42c61cbaabd10e162b449ade5ec6e
100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -79,11 +79,6 @@ namespace internal {
static Mutex* limit_mutex = NULL;
-uint64_t OS::CpuFeaturesImpliedByPlatform() {
- return 0; // Linux runs on anything.
-}
-
-
#ifdef __arm__
static bool CPUInfoContainsString(const char * search_string) {
const char* file_name = "/proc/cpuinfo";
Index: src/platform-macos.cc
diff --git a/src/platform-macos.cc b/src/platform-macos.cc
index
8ec4c510403899ee7ac39ad4cf3e7435f59ba074..10aef80d9caa7317323e4b379acdc5fe68f7ca93
100644
--- a/src/platform-macos.cc
+++ b/src/platform-macos.cc
@@ -231,14 +231,6 @@ void OS::SignalCodeMovingGC() {
}
-uint64_t OS::CpuFeaturesImpliedByPlatform() {
- // MacOSX requires all these to install so we can assume they are
present.
- // These constants are defined by the CPUid instructions.
- const uint64_t one = 1;
- return (one << SSE2) | (one << CMOV) | (one << RDTSC) | (one << CPUID);
-}
-
-
int OS::ActivationFrameAlignment() {
// OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI
// Function Call Guide".
Index: src/platform-openbsd.cc
diff --git a/src/platform-openbsd.cc b/src/platform-openbsd.cc
index
a94bfe8aa46b6a3cd117da6c5c5f8696ed5b5b56..57b6d69d73fc3d4e3b58ef5f9d9a406d499ee0a5
100644
--- a/src/platform-openbsd.cc
+++ b/src/platform-openbsd.cc
@@ -91,11 +91,6 @@ static void* GetRandomMmapAddr() {
}
-uint64_t OS::CpuFeaturesImpliedByPlatform() {
- return 0;
-}
-
-
int OS::ActivationFrameAlignment() {
// With gcc 4.4 the tree vectorization optimizer can generate code
// that requires 16 byte alignment such as movdqa on x86.
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index
9bc3193631aab80a0b71e799259c2c35b1d19e65..cd2b9b9da4e3a34bd0cb80b5141b1258c1327ad8
100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -78,6 +78,18 @@ namespace internal {
static const pthread_t kNoThread = (pthread_t) 0;
+uint64_t OS::CpuFeaturesImpliedByPlatform() {
+#if defined(__APPLE__)
+ // Mac OS X requires all these to install so we can assume they are
present.
+ // These constants are defined by the CPUid instructions.
+ const uint64_t one = 1;
+ return (one << SSE2) | (one << CMOV) | (one << RDTSC) | (one << CPUID);
+#else
+ return 0; // Nothing special about the other systems.
+#endif
+}
+
+
// Maximum size of the virtual memory. 0 means there is no artificial
// limit.
Index: src/platform-solaris.cc
diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc
index
cb9ba18f97289044f5ea5d15fa531b9735e01e93..46fff60e191466e72d0cb6e899556841ef58bf01
100644
--- a/src/platform-solaris.cc
+++ b/src/platform-solaris.cc
@@ -84,11 +84,6 @@ namespace internal {
static Mutex* limit_mutex = NULL;
-uint64_t OS::CpuFeaturesImpliedByPlatform() {
- return 0; // Solaris runs on a lot of things.
-}
-
-
int OS::ActivationFrameAlignment() {
// GCC generates code that requires 16 byte alignment such as movdqa.
return Max(STACK_ALIGN, 16);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.