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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 #endif | 600 #endif |
601 | 601 |
602 #elif V8_HOST_ARCH_ARM64 | 602 #elif V8_HOST_ARCH_ARM64 |
603 | 603 |
604 CPUInfo cpu_info; | 604 CPUInfo cpu_info; |
605 | 605 |
606 // Extract implementor from the "CPU implementer" field. | 606 // Extract implementor from the "CPU implementer" field. |
607 char* implementer = cpu_info.ExtractField("CPU implementer"); | 607 char* implementer = cpu_info.ExtractField("CPU implementer"); |
608 if (implementer != NULL) { | 608 if (implementer != NULL) { |
609 char* end; | 609 char* end; |
610 implementer_ = strtol(implementer, &end, 0); | 610 implementer_ = static_cast<int>(strtol(implementer, &end, 0)); |
611 if (end == implementer) { | 611 if (end == implementer) { |
612 implementer_ = 0; | 612 implementer_ = 0; |
613 } | 613 } |
614 delete[] implementer; | 614 delete[] implementer; |
615 } | 615 } |
616 | 616 |
617 char* variant = cpu_info.ExtractField("CPU variant"); | 617 char* variant = cpu_info.ExtractField("CPU variant"); |
618 if (variant != NULL) { | 618 if (variant != NULL) { |
619 char* end; | 619 char* end; |
620 variant_ = strtol(variant, &end, 0); | 620 variant_ = static_cast<int>(strtol(variant, &end, 0)); |
621 if (end == variant) { | 621 if (end == variant) { |
622 variant_ = -1; | 622 variant_ = -1; |
623 } | 623 } |
624 delete[] variant; | 624 delete[] variant; |
625 } | 625 } |
626 | 626 |
627 // Extract part number from the "CPU part" field. | 627 // Extract part number from the "CPU part" field. |
628 char* part = cpu_info.ExtractField("CPU part"); | 628 char* part = cpu_info.ExtractField("CPU part"); |
629 if (part != NULL) { | 629 if (part != NULL) { |
630 char* end; | 630 char* end; |
631 part_ = strtol(part, &end, 0); | 631 part_ = static_cast<int>(strtol(part, &end, 0)); |
632 if (end == part) { | 632 if (end == part) { |
633 part_ = 0; | 633 part_ = 0; |
634 } | 634 } |
635 delete[] part; | 635 delete[] part; |
636 } | 636 } |
637 | 637 |
638 #elif V8_HOST_ARCH_PPC | 638 #elif V8_HOST_ARCH_PPC |
639 | 639 |
640 #ifndef USE_SIMULATOR | 640 #ifndef USE_SIMULATOR |
641 #if V8_OS_LINUX | 641 #if V8_OS_LINUX |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 part_ = PPC_POWER5; | 702 part_ = PPC_POWER5; |
703 break; | 703 break; |
704 } | 704 } |
705 #endif // V8_OS_AIX | 705 #endif // V8_OS_AIX |
706 #endif // !USE_SIMULATOR | 706 #endif // !USE_SIMULATOR |
707 #endif // V8_HOST_ARCH_PPC | 707 #endif // V8_HOST_ARCH_PPC |
708 } | 708 } |
709 | 709 |
710 } // namespace base | 710 } // namespace base |
711 } // namespace v8 | 711 } // namespace v8 |
OLD | NEW |