Title: [211167] trunk/Source/_javascript_Core
Revision
211167
Author
[email protected]
Date
2017-01-25 14:42:22 -0800 (Wed, 25 Jan 2017)

Log Message

ARM/ARM64 stress/atomics-store-return.js fails
<rdar://problem/30192652>

Reviewed by Michael Saboff.
        
The problem was relying on double->int casts for anything. We need to use toInt32().

* runtime/AtomicsObject.cpp:
(JSC::atomicsFuncCompareExchange):
(JSC::atomicsFuncExchange):
(JSC::atomicsFuncStore):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (211166 => 211167)


--- trunk/Source/_javascript_Core/ChangeLog	2017-01-25 22:36:48 UTC (rev 211166)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-01-25 22:42:22 UTC (rev 211167)
@@ -1,3 +1,17 @@
+2017-01-25  Filip Pizlo  <[email protected]>
+
+        ARM/ARM64 stress/atomics-store-return.js fails
+        <rdar://problem/30192652>
+
+        Reviewed by Michael Saboff.
+        
+        The problem was relying on double->int casts for anything. We need to use toInt32().
+
+        * runtime/AtomicsObject.cpp:
+        (JSC::atomicsFuncCompareExchange):
+        (JSC::atomicsFuncExchange):
+        (JSC::atomicsFuncStore):
+
 2017-01-25  Ryosuke Niwa  <[email protected]>
 
         collectMatchingElementsInFlatTree should not find elements inside an user agent shadow tree

Modified: trunk/Source/_javascript_Core/runtime/AtomicsObject.cpp (211166 => 211167)


--- trunk/Source/_javascript_Core/runtime/AtomicsObject.cpp	2017-01-25 22:36:48 UTC (rev 211166)
+++ trunk/Source/_javascript_Core/runtime/AtomicsObject.cpp	2017-01-25 22:42:22 UTC (rev 211167)
@@ -209,8 +209,8 @@
     return atomicOperationWithArgs<2>(
         exec, [&] (auto* ptr, const double* args) {
             typedef typename std::remove_pointer<decltype(ptr)>::type T;
-            T expected = static_cast<T>(args[0]);
-            T newValue = static_cast<T>(args[1]);
+            T expected = static_cast<T>(toInt32(args[0]));
+            T newValue = static_cast<T>(toInt32(args[1]));
             return jsNumber(WTF::atomicCompareExchangeStrong(ptr, expected, newValue));
         });
 }
@@ -220,7 +220,7 @@
     return atomicOperationWithArgs<1>(
         exec, [&] (auto* ptr, const double* args) {
             typedef typename std::remove_pointer<decltype(ptr)>::type T;
-            return jsNumber(WTF::atomicExchange(ptr, static_cast<T>(args[0])));
+            return jsNumber(WTF::atomicExchange(ptr, static_cast<T>(toInt32(args[0]))));
         });
 }
 
@@ -268,7 +268,7 @@
         exec, [&] (auto* ptr, const double* args) {
             typedef typename std::remove_pointer<decltype(ptr)>::type T;
             double valueAsInt = args[0];
-            T valueAsT = static_cast<T>(valueAsInt);
+            T valueAsT = static_cast<T>(toInt32(valueAsInt));
             WTF::atomicStore(ptr, valueAsT);
             return jsNumber(valueAsInt);
         });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to