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

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

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates 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
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/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
11 #include <unistd.h> // sysconf() 11 #include <unistd.h> // sysconf()
12 #endif 12 #endif
13 #if V8_OS_QNX 13 #if V8_OS_QNX
14 #include <sys/syspage.h> // cpuinfo 14 #include <sys/syspage.h> // cpuinfo
15 #endif 15 #endif
16 16
17 #include <ctype.h> 17 #include <ctype.h>
18 #include <limits.h> 18 #include <limits.h>
19 #include <stdio.h> 19 #include <stdio.h>
20 #include <stdlib.h> 20 #include <stdlib.h>
21 #include <string.h> 21 #include <string.h>
22 #include <algorithm> 22 #include <algorithm>
23 23
24 #include "src/checks.h" 24 #include "src/base/logging.h"
25 #if V8_OS_WIN 25 #if V8_OS_WIN
26 #include "src/base/win32-headers.h" // NOLINT 26 #include "src/base/win32-headers.h" // NOLINT
27 #endif 27 #endif
28 28
29 namespace v8 { 29 namespace v8 {
30 namespace internal { 30 namespace base {
31 31
32 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 32 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
33 33
34 // Define __cpuid() for non-MSVC libraries. 34 // Define __cpuid() for non-MSVC libraries.
35 #if !V8_LIBC_MSVCRT 35 #if !V8_LIBC_MSVCRT
36 36
37 static V8_INLINE void __cpuid(int cpu_info[4], int info_type) { 37 static V8_INLINE void __cpuid(int cpu_info[4], int info_type) {
38 #if defined(__i386__) && defined(__pic__) 38 #if defined(__i386__) && defined(__pic__)
39 // Make sure to preserve ebx, which contains the pointer 39 // Make sure to preserve ebx, which contains the pointer
40 // to the GOT in case we're generating PIC. 40 // to the GOT in case we're generating PIC.
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 part_ = strtol(part, &end, 0); 488 part_ = strtol(part, &end, 0);
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::internal 498 } } // namespace v8::base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698