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

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

Issue 23401002: Fix the CPU feature detection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Improve cpuinfo parsing. Created 7 years, 4 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-nullos.cc ('k') | src/v8globals.h » ('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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() { 81 uint64_t OS::CpuFeaturesImpliedByPlatform() {
82 #if defined(__APPLE__) 82 #if V8_OS_MACOSX
83 // Mac OS X requires all these to install so we can assume they are present. 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. 84 // These constants are defined by the CPUid instructions.
85 const uint64_t one = 1; 85 const uint64_t one = 1;
86 return (one << SSE2) | (one << CMOV) | (one << CPUID); 86 return (one << SSE2) | (one << CMOV);
87 #else 87 #else
88 return 0; // Nothing special about the other systems. 88 return 0; // Nothing special about the other systems.
89 #endif 89 #endif
90 } 90 }
91 91
92 92
93 // 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
94 // limit. 94 // limit.
95 95
96 intptr_t OS::MaxVirtualMemory() { 96 intptr_t OS::MaxVirtualMemory() {
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 return ntohl(value); 990 return ntohl(value);
991 } 991 }
992 992
993 993
994 Socket* OS::CreateSocket() { 994 Socket* OS::CreateSocket() {
995 return new POSIXSocket(); 995 return new POSIXSocket();
996 } 996 }
997 997
998 998
999 } } // namespace v8::internal 999 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-nullos.cc ('k') | src/v8globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698