OLD | NEW |
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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 if (part != NULL) { | 649 if (part != NULL) { |
650 char* end; | 650 char* end; |
651 part_ = strtol(part, &end, 0); | 651 part_ = strtol(part, &end, 0); |
652 if (end == part) { | 652 if (end == part) { |
653 part_ = 0; | 653 part_ = 0; |
654 } | 654 } |
655 delete[] part; | 655 delete[] part; |
656 } | 656 } |
657 | 657 |
658 CacheLineSizes sizes; | 658 CacheLineSizes sizes; |
659 icache_line_size_ = sizes.dcache_line_size(); | 659 icache_line_size_ = sizes.icache_line_size(); |
660 dcache_line_size_ = sizes.icache_line_size(); | 660 dcache_line_size_ = sizes.dcache_line_size(); |
661 | 661 |
662 #elif V8_HOST_ARCH_PPC | 662 #elif V8_HOST_ARCH_PPC |
663 | 663 |
664 #ifndef USE_SIMULATOR | 664 #ifndef USE_SIMULATOR |
665 #if V8_OS_LINUX | 665 #if V8_OS_LINUX |
666 // Read processor info from /proc/self/auxv. | 666 // Read processor info from /proc/self/auxv. |
667 char* auxv_cpu_type = NULL; | 667 char* auxv_cpu_type = NULL; |
668 FILE* fp = fopen("/proc/self/auxv", "r"); | 668 FILE* fp = fopen("/proc/self/auxv", "r"); |
669 if (fp != NULL) { | 669 if (fp != NULL) { |
670 #if V8_TARGET_ARCH_PPC64 | 670 #if V8_TARGET_ARCH_PPC64 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 part_ = PPC_POWER5; | 726 part_ = PPC_POWER5; |
727 break; | 727 break; |
728 } | 728 } |
729 #endif // V8_OS_AIX | 729 #endif // V8_OS_AIX |
730 #endif // !USE_SIMULATOR | 730 #endif // !USE_SIMULATOR |
731 #endif // V8_HOST_ARCH_PPC | 731 #endif // V8_HOST_ARCH_PPC |
732 } | 732 } |
733 | 733 |
734 } // namespace base | 734 } // namespace base |
735 } // namespace v8 | 735 } // namespace v8 |
OLD | NEW |