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

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

Issue 360723002: Fix compilation on arm after r22092 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/arm/assembler-arm.cc ('k') | no next file » | 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_POSIX 10 #if V8_OS_POSIX
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 } 109 }
110 fclose(fp); 110 fclose(fp);
111 } 111 }
112 return result; 112 return result;
113 } 113 }
114 114
115 #endif // V8_HOST_ARCH_ARM 115 #endif // V8_HOST_ARCH_ARM
116 116
117 // Extract the information exposed by the kernel via /proc/cpuinfo. 117 // Extract the information exposed by the kernel via /proc/cpuinfo.
118 class CPUInfo V8_FINAL BASE_EMBEDDED { 118 class CPUInfo V8_FINAL {
119 public: 119 public:
120 CPUInfo() : datalen_(0) { 120 CPUInfo() : datalen_(0) {
121 // Get the size of the cpuinfo file by reading it until the end. This is 121 // Get the size of the cpuinfo file by reading it until the end. This is
122 // required because files under /proc do not always return a valid size 122 // required because files under /proc do not always return a valid size
123 // when using fseek(0, SEEK_END) + ftell(). Nor can the be mmap()-ed. 123 // when using fseek(0, SEEK_END) + ftell(). Nor can the be mmap()-ed.
124 static const char PATHNAME[] = "/proc/cpuinfo"; 124 static const char PATHNAME[] = "/proc/cpuinfo";
125 FILE* fp = fopen(PATHNAME, "r"); 125 FILE* fp = fopen(PATHNAME, "r");
126 if (fp != NULL) { 126 if (fp != NULL) {
127 for (;;) { 127 for (;;) {
128 char buffer[256]; 128 char buffer[256];
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 if (end == part) { 489 if (end == part) {
490 part_ = 0; 490 part_ = 0;
491 } 491 }
492 delete[] part; 492 delete[] part;
493 } 493 }
494 494
495 #endif 495 #endif
496 } 496 }
497 497
498 } } // namespace v8::base 498 } } // namespace v8::base
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698