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

Unified Diff: src/ia32/assembler-ia32.cc

Issue 808333005: [x86] Blacklist AVX for all Mac OS versions up to 10.9. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/x64/assembler-x64.cc » ('j') | src/x64/assembler-x64.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/assembler-ia32.cc
diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc
index 168a19644981172fc3268d9e87c38aa2dc13a177..28c4c1ba68289cf5b7f799e9651caeb22379f9ee 100644
--- a/src/ia32/assembler-ia32.cc
+++ b/src/ia32/assembler-ia32.cc
@@ -58,8 +58,8 @@ namespace {
bool EnableAVX() {
#if V8_OS_MACOSX
- // Mac OS X 10.9 has a bug where AVX transitions were indeed being caused by
- // ISRs, so we detect Mac OS X 10.9 here and disable AVX in that case.
+ // Mac OS X up to 10.9 has a bug where AVX transitions were indeed being
+ // caused by ISRs, so we detect that here and disable AVX in that case.
char buffer[128];
size_t buffer_size = arraysize(buffer);
int ctl_name[] = { CTL_KERN , KERN_OSRELEASE };
@@ -67,9 +67,14 @@ bool EnableAVX() {
V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version");
}
// The buffer now contains a string of the form XX.YY.ZZ, where
- // XX is the major kernel version component. 13.x.x (Mavericks) is
- // affected by this bug, so disable AVX there.
- if (memcmp(buffer, "13.", 3) == 0) return false;
+ // XX is the major kernel version component.
+ // Make sure the buffer is 0-terminated.
Sven Panne 2015/01/07 12:08:44 System information of type "string" is always zero
+ buffer[arraysize(buffer) - 1] = '\0';
+ char* period_pos = strchr(buffer, '.');
+ DCHECK_NOT_NULL(period_pos);
+ *period_pos = '\0';
+ long kernel_version_major = strtol(buffer, nullptr, 10); // NOLINT
+ if (kernel_version_major <= 13) return false;
#endif // V8_OS_MACOSX
return FLAG_enable_avx;
}
« no previous file with comments | « no previous file | src/x64/assembler-x64.cc » ('j') | src/x64/assembler-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698