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

Side by Side Diff: src/x64/assembler-x64.cc

Issue 888613002: Initial switch to Chromium-style CHECK_* and DCHECK_* macros. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix slow dchecks. Created 5 years, 10 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/x64/assembler-x64.h" 5 #include "src/x64/assembler-x64.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #if V8_TARGET_ARCH_X64 9 #if V8_TARGET_ARCH_X64
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // caused by ISRs, so we detect that here and disable AVX in that case. 50 // caused by ISRs, so we detect that here and disable AVX in that case.
51 char buffer[128]; 51 char buffer[128];
52 size_t buffer_size = arraysize(buffer); 52 size_t buffer_size = arraysize(buffer);
53 int ctl_name[] = {CTL_KERN, KERN_OSRELEASE}; 53 int ctl_name[] = {CTL_KERN, KERN_OSRELEASE};
54 if (sysctl(ctl_name, 2, buffer, &buffer_size, nullptr, 0) != 0) { 54 if (sysctl(ctl_name, 2, buffer, &buffer_size, nullptr, 0) != 0) {
55 V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version"); 55 V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version");
56 } 56 }
57 // The buffer now contains a string of the form XX.YY.ZZ, where 57 // The buffer now contains a string of the form XX.YY.ZZ, where
58 // XX is the major kernel version component. 58 // XX is the major kernel version component.
59 char* period_pos = strchr(buffer, '.'); 59 char* period_pos = strchr(buffer, '.');
60 DCHECK_NOT_NULL(period_pos); 60 DCHECK(period_pos);
61 *period_pos = '\0'; 61 *period_pos = '\0';
62 long kernel_version_major = strtol(buffer, nullptr, 10); // NOLINT 62 long kernel_version_major = strtol(buffer, nullptr, 10); // NOLINT
63 if (kernel_version_major <= 13) return false; 63 if (kernel_version_major <= 13) return false;
64 #endif // V8_OS_MACOSX 64 #endif // V8_OS_MACOSX
65 // Check whether OS claims to support AVX. 65 // Check whether OS claims to support AVX.
66 uint64_t feature_mask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK); 66 uint64_t feature_mask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
67 return (feature_mask & 0x6) == 0x6; 67 return (feature_mask & 0x6) == 0x6;
68 } 68 }
69 69
70 } // namespace 70 } // namespace
(...skipping 3344 matching lines...) Expand 10 before | Expand all | Expand 10 after
3415 3415
3416 3416
3417 bool RelocInfo::IsInConstantPool() { 3417 bool RelocInfo::IsInConstantPool() {
3418 return false; 3418 return false;
3419 } 3419 }
3420 3420
3421 3421
3422 } } // namespace v8::internal 3422 } } // namespace v8::internal
3423 3423
3424 #endif // V8_TARGET_ARCH_X64 3424 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/jsregexp.cc ('K') | « src/v8.h ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698