Title: [153345] trunk/Source/WTF
- Revision
- 153345
- Author
- [email protected]
- Date
- 2013-07-25 13:56:43 -0700 (Thu, 25 Jul 2013)
Log Message
[Windows] Provide ASM implemenation of 8-bit compare-and-swap
https://bugs.webkit.org/show_bug.cgi?id=119084
Patch by [email protected] <[email protected]> on 2013-07-25
Reviewed by Brent Fulgham.
* wtf/Atomics.h:
(WTF::weakCompareAndSwap): Add a 32-bit X86 Assembly path for
Windows build.
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (153344 => 153345)
--- trunk/Source/WTF/ChangeLog 2013-07-25 20:52:59 UTC (rev 153344)
+++ trunk/Source/WTF/ChangeLog 2013-07-25 20:56:43 UTC (rev 153345)
@@ -1,3 +1,14 @@
+2013-07-25 [email protected] <[email protected]>
+
+ [Windows] Provide ASM implemenation of 8-bit compare-and-swap
+ https://bugs.webkit.org/show_bug.cgi?id=119084
+
+ Reviewed by Brent Fulgham.
+
+ * wtf/Atomics.h:
+ (WTF::weakCompareAndSwap): Add a 32-bit X86 Assembly path for
+ Windows build.
+
2013-07-25 Brent Fulgham <[email protected]>
[Windows] Unreviewed build fix.
Modified: trunk/Source/WTF/wtf/Atomics.h (153344 => 153345)
--- trunk/Source/WTF/wtf/Atomics.h 2013-07-25 20:52:59 UTC (rev 153344)
+++ trunk/Source/WTF/wtf/Atomics.h 2013-07-25 20:56:43 UTC (rev 153345)
@@ -288,6 +288,20 @@
: "memory"
);
return result;
+#elif OS(WINDOWS) && CPU(X86)
+ // 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;
+
+ __asm {
+ mov al, expected
+ mov edx, location
+ mov cl, newValue
+ lock cmpxchg byte ptr[edx], cl
+ setz result
+ }
+
+ return result;
#else
uintptr_t locationValue = bitwise_cast<uintptr_t>(location);
uintptr_t alignedLocationValue = locationValue & ~(sizeof(unsigned) - 1);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes