| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // caused by ISRs, so we detect that here and disable AVX in that case. | 84 // caused by ISRs, so we detect that here and disable AVX in that case. |
| 85 char buffer[128]; | 85 char buffer[128]; |
| 86 size_t buffer_size = arraysize(buffer); | 86 size_t buffer_size = arraysize(buffer); |
| 87 int ctl_name[] = {CTL_KERN, KERN_OSRELEASE}; | 87 int ctl_name[] = {CTL_KERN, KERN_OSRELEASE}; |
| 88 if (sysctl(ctl_name, 2, buffer, &buffer_size, nullptr, 0) != 0) { | 88 if (sysctl(ctl_name, 2, buffer, &buffer_size, nullptr, 0) != 0) { |
| 89 V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version"); | 89 V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version"); |
| 90 } | 90 } |
| 91 // The buffer now contains a string of the form XX.YY.ZZ, where | 91 // The buffer now contains a string of the form XX.YY.ZZ, where |
| 92 // XX is the major kernel version component. | 92 // XX is the major kernel version component. |
| 93 char* period_pos = strchr(buffer, '.'); | 93 char* period_pos = strchr(buffer, '.'); |
| 94 DCHECK_NOT_NULL(period_pos); | 94 DCHECK(period_pos); |
| 95 *period_pos = '\0'; | 95 *period_pos = '\0'; |
| 96 long kernel_version_major = strtol(buffer, nullptr, 10); // NOLINT | 96 long kernel_version_major = strtol(buffer, nullptr, 10); // NOLINT |
| 97 if (kernel_version_major <= 13) return false; | 97 if (kernel_version_major <= 13) return false; |
| 98 #endif // V8_OS_MACOSX | 98 #endif // V8_OS_MACOSX |
| 99 // Check whether OS claims to support AVX. | 99 // Check whether OS claims to support AVX. |
| 100 uint64_t feature_mask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK); | 100 uint64_t feature_mask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK); |
| 101 return (feature_mask & 0x6) == 0x6; | 101 return (feature_mask & 0x6) == 0x6; |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| (...skipping 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2811 fprintf(coverage_log, "%s\n", file_line); | 2811 fprintf(coverage_log, "%s\n", file_line); |
| 2812 fflush(coverage_log); | 2812 fflush(coverage_log); |
| 2813 } | 2813 } |
| 2814 } | 2814 } |
| 2815 | 2815 |
| 2816 #endif | 2816 #endif |
| 2817 | 2817 |
| 2818 } } // namespace v8::internal | 2818 } } // namespace v8::internal |
| 2819 | 2819 |
| 2820 #endif // V8_TARGET_ARCH_IA32 | 2820 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |