Title: [184552] releases/WebKitGTK/webkit-2.4/Source/WTF
Revision
184552
Author
[email protected]
Date
2015-05-18 23:49:56 -0700 (Mon, 18 May 2015)

Log Message

[W32] weakCompareAndSwap assembler code is not used when building with MinGW GCC
https://bugs.webkit.org/show_bug.cgi?id=143754

Unreviewed.

Allow MinGW-GCC to use GCC asm code for weakCompareAndSwap.

Patch by Руслан Ижбулатов <[email protected]> on 2015-04-16

* wtf/Atomics.h:
(WTF::x86_mfence):
(WTF::weakCompareAndSwap):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog (184551 => 184552)


--- releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog	2015-05-19 06:43:06 UTC (rev 184551)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog	2015-05-19 06:49:56 UTC (rev 184552)
@@ -1,3 +1,16 @@
+2015-04-16  Руслан Ижбулатов  <[email protected]>
+
+        [W32] weakCompareAndSwap assembler code is not used when building with MinGW GCC
+        https://bugs.webkit.org/show_bug.cgi?id=143754
+
+        Unreviewed.
+
+        Allow MinGW-GCC to use GCC asm code for weakCompareAndSwap.
+
+        * wtf/Atomics.h:
+        (WTF::x86_mfence):
+        (WTF::weakCompareAndSwap):
+
 2015-04-15  Руслан Ижбулатов  <[email protected]>
 
         [W32] GraphicsContextCairoWin.cpp fails to compile: unallowed function template partial specialization

Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/Atomics.h (184551 => 184552)


--- releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/Atomics.h	2015-05-19 06:43:06 UTC (rev 184551)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/Atomics.h	2015-05-19 06:49:56 UTC (rev 184552)
@@ -72,7 +72,7 @@
 
 namespace WTF {
 
-#if OS(WINDOWS)
+#if OS(WINDOWS) && !COMPILER(GCC)
 inline bool weakCompareAndSwap(volatile unsigned* location, unsigned expected, unsigned newValue)
 {
 #if OS(WINCE)
@@ -86,7 +86,7 @@
 {
     return InterlockedCompareExchangePointer(location, newValue, expected) == expected;
 }
-#else // OS(WINDOWS) --> not windows
+#else // OS(WINDOWS) && !COMPILER(GCC) --> not windows, but maybe mingw
 inline bool weakCompareAndSwap(volatile unsigned* location, unsigned expected, unsigned newValue) 
 {
 #if ENABLE(COMPARE_AND_SWAP)
@@ -178,7 +178,7 @@
     return 0;
 #endif // ENABLE(COMPARE_AND_SWAP)
 }
-#endif // OS(WINDOWS) (end of the not-windows case)
+#endif // OS(WINDOWS) && !COMPILER(GCC) (end of the not-windows (but maybe mingw) case)
 
 inline bool weakCompareAndSwapUIntPtr(volatile uintptr_t* location, uintptr_t expected, uintptr_t newValue)
 {
@@ -228,7 +228,7 @@
 
 inline void x86_mfence()
 {
-#if OS(WINDOWS)
+#if OS(WINDOWS) && !COMPILER(GCC)
     // I think that this does the equivalent of a dummy interlocked instruction,
     // instead of using the 'mfence' instruction, at least according to MSDN. I
     // know that it is equivalent for our purposes, but it would be good to
@@ -260,7 +260,8 @@
 inline bool weakCompareAndSwap(uint8_t* location, uint8_t expected, uint8_t newValue)
 {
 #if ENABLE(COMPARE_AND_SWAP)
-#if !OS(WINDOWS) && (CPU(X86) || CPU(X86_64))
+#if !COMPILER(MSVC) && (CPU(X86) || CPU(X86_64))
+    // !COMPILER(MSVC) here means "ASM_SYNTAX(AT_AND_T)"
     unsigned char result;
     asm volatile(
         "lock; cmpxchgb %3, %2\n\t"
@@ -270,7 +271,8 @@
         : "memory"
         );
     return result;
-#elif OS(WINDOWS) && CPU(X86)
+#elif COMPILER(MSVC) && CPU(X86)
+    // COMPILER(MSVC) here means "ASM_SYNTAX(INTEL)"
     // FIXME: We need a 64-bit ASM implementation, but this cannot be inline due to
     // Microsoft's decision to exclude it from the compiler.
     bool result = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to