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

Side by Side Diff: src/base/cpu.cc

Issue 1088993003: Replace OVERRIDE->override and FINAL->final since we now require C++11. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « src/base/cpu.h ('k') | src/base/flags.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/base/cpu.h" 5 #include "src/base/cpu.h"
6 6
7 #if V8_LIBC_MSVCRT 7 #if V8_LIBC_MSVCRT
8 #include <intrin.h> // __cpuid() 8 #include <intrin.h> // __cpuid()
9 #endif 9 #endif
10 #if V8_OS_LINUX 10 #if V8_OS_LINUX
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 : "=m"(result) 171 : "=m"(result)
172 : 172 :
173 : "v0", "memory"); 173 : "v0", "memory");
174 // Result is 0 on r6 architectures, 1 on other architecture revisions. 174 // Result is 0 on r6 architectures, 1 on other architecture revisions.
175 // Fall-back to the least common denominator which is mips32 revision 1. 175 // Fall-back to the least common denominator which is mips32 revision 1.
176 return result ? 1 : 6; 176 return result ? 1 : 6;
177 } 177 }
178 #endif 178 #endif
179 179
180 // Extract the information exposed by the kernel via /proc/cpuinfo. 180 // Extract the information exposed by the kernel via /proc/cpuinfo.
181 class CPUInfo FINAL { 181 class CPUInfo final {
182 public: 182 public:
183 CPUInfo() : datalen_(0) { 183 CPUInfo() : datalen_(0) {
184 // Get the size of the cpuinfo file by reading it until the end. This is 184 // Get the size of the cpuinfo file by reading it until the end. This is
185 // required because files under /proc do not always return a valid size 185 // required because files under /proc do not always return a valid size
186 // when using fseek(0, SEEK_END) + ftell(). Nor can the be mmap()-ed. 186 // when using fseek(0, SEEK_END) + ftell(). Nor can the be mmap()-ed.
187 static const char PATHNAME[] = "/proc/cpuinfo"; 187 static const char PATHNAME[] = "/proc/cpuinfo";
188 FILE* fp = fopen(PATHNAME, "r"); 188 FILE* fp = fopen(PATHNAME, "r");
189 if (fp != NULL) { 189 if (fp != NULL) {
190 for (;;) { 190 for (;;) {
191 char buffer[256]; 191 char buffer[256];
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 case POWER_5: 685 case POWER_5:
686 part_ = PPC_POWER5; 686 part_ = PPC_POWER5;
687 break; 687 break;
688 } 688 }
689 #endif // V8_OS_AIX 689 #endif // V8_OS_AIX
690 #endif // !USE_SIMULATOR 690 #endif // !USE_SIMULATOR
691 #endif // V8_HOST_ARCH_PPC 691 #endif // V8_HOST_ARCH_PPC
692 } 692 }
693 693
694 } } // namespace v8::base 694 } } // namespace v8::base
OLDNEW
« no previous file with comments | « src/base/cpu.h ('k') | src/base/flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698