summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael.bruning@digia.com <michael.bruning@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>2013-07-10 08:36:13 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-10 11:05:12 +0200
commit42a16bccb1750f0e4094d9d6366200a5deae9184 (patch)
tree8723c361f7a3ebb43730aeb077c5c7a896df103c
parente547fc9a9d1d6826cc9bb39c20331c4eff444d42 (diff)
downloadqtwebkit-42a16bccb1750f0e4094d9d6366200a5deae9184.tar.gz
Workaround for x86 optimizer bug in MSVC 2012.
https://bugs.webkit.org/show_bug.cgi?id=118478 Reviewed by Benjamin Poulain. This is a workaround for a bug in the x86 MSVC 2012 optimizer. The problem is that the range comparison gets optimized out when the templated inline function toASCIIUpper. Copying the methods content fixes the problem. This is unfortunately not the nicest fix, but the alternative would be to turn off optimization for StringImpl::upper on the x86 MSVC 2012 build, which might impact overall performance negatively. * wtf/text/StringImpl.cpp: (WTF::StringImpl::upper): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152529 268f45cc-cd09-0410-ab3c-d52691b4dbfc Change-Id: Ia08780b3b2216a10fb7a7beb8b7298b84726417a Task-number: QTBUG-32159 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--Source/WTF/wtf/text/StringImpl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/WTF/wtf/text/StringImpl.cpp b/Source/WTF/wtf/text/StringImpl.cpp
index f995c6414..0c8da50ff 100644
--- a/Source/WTF/wtf/text/StringImpl.cpp
+++ b/Source/WTF/wtf/text/StringImpl.cpp
@@ -480,7 +480,14 @@ PassRefPtr<StringImpl> StringImpl::upper()
for (int i = 0; i < length; ++i) {
LChar c = m_data8[i];
ored |= c;
+#if CPU(X86) && defined(_MSC_VER) && _MSC_VER >=1700
+ // Workaround for an MSVC 2012 x86 optimizer bug. Remove once the bug is fixed.
+ // See https://connect.microsoft.com/VisualStudio/feedback/details/780362/optimization-bug-of-range-comparison
+ // for more details.
+ data8[i] = c >= 'a' && c <= 'z' ? c & ~0x20 : c;
+#else
data8[i] = toASCIIUpper(c);
+#endif
}
if (!(ored & ~0x7F))
return newImpl.release();