Title: [152529] trunk/Source/WTF
Revision
152529
Author
[email protected]
Date
2013-07-10 01:36:13 -0700 (Wed, 10 Jul 2013)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (152528 => 152529)


--- trunk/Source/WTF/ChangeLog	2013-07-10 08:13:15 UTC (rev 152528)
+++ trunk/Source/WTF/ChangeLog	2013-07-10 08:36:13 UTC (rev 152529)
@@ -1,3 +1,23 @@
+2013-07-10  Michael BrĂ¼ning  <[email protected]>
+
+        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):
+
 2013-07-08  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Fix make distcheck.

Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (152528 => 152529)


--- trunk/Source/WTF/wtf/text/StringImpl.cpp	2013-07-10 08:13:15 UTC (rev 152528)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp	2013-07-10 08:36:13 UTC (rev 152529)
@@ -485,7 +485,14 @@
         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();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to