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

Side by Side Diff: src/platform-posix.cc

Issue 20179004: Don't duplicate OS::CpuFeaturesImpliedByPlatform for every POSIX platform. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include "codegen.h" 71 #include "codegen.h"
72 #include "platform.h" 72 #include "platform.h"
73 73
74 namespace v8 { 74 namespace v8 {
75 namespace internal { 75 namespace internal {
76 76
77 // 0 is never a valid thread id. 77 // 0 is never a valid thread id.
78 static const pthread_t kNoThread = (pthread_t) 0; 78 static const pthread_t kNoThread = (pthread_t) 0;
79 79
80 80
81 uint64_t OS::CpuFeaturesImpliedByPlatform() {
82 #if defined(__APPLE__)
83 // Mac OS X requires all these to install so we can assume they are present.
84 // These constants are defined by the CPUid instructions.
85 const uint64_t one = 1;
86 return (one << SSE2) | (one << CMOV) | (one << RDTSC) | (one << CPUID);
87 #else
88 return 0; // Nothing special about the other systems.
89 #endif
90 }
91
92
81 // Maximum size of the virtual memory. 0 means there is no artificial 93 // Maximum size of the virtual memory. 0 means there is no artificial
82 // limit. 94 // limit.
83 95
84 intptr_t OS::MaxVirtualMemory() { 96 intptr_t OS::MaxVirtualMemory() {
85 struct rlimit limit; 97 struct rlimit limit;
86 int result = getrlimit(RLIMIT_DATA, &limit); 98 int result = getrlimit(RLIMIT_DATA, &limit);
87 if (result != 0) return 0; 99 if (result != 0) return 0;
88 return limit.rlim_cur; 100 return limit.rlim_cur;
89 } 101 }
90 102
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 return ntohl(value); 972 return ntohl(value);
961 } 973 }
962 974
963 975
964 Socket* OS::CreateSocket() { 976 Socket* OS::CreateSocket() {
965 return new POSIXSocket(); 977 return new POSIXSocket();
966 } 978 }
967 979
968 980
969 } } // namespace v8::internal 981 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698