2009-01-13 Gavin Barraclough <barraclough@apple.com>
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2009 00:15:36 +0000 (00:15 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2009 00:15:36 +0000 (00:15 +0000)
        Reviewed by Oliver Hunt.

        Fix for: https://bugs.webkit.org/show_bug.cgi?id=23292

        Implementation of two argument canDoFastAdditiveOperations does not correlate well with reality.

        * runtime/JSImmediate.h:
        (JSC::JSFastMath::canDoFastAdditiveOperations):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/runtime/JSImmediate.h

index 73d8e2e..a850a61 100644 (file)
@@ -1,3 +1,14 @@
+2009-01-13  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Fix for: https://bugs.webkit.org/show_bug.cgi?id=23292
+
+        Implementation of two argument canDoFastAdditiveOperations does not correlate well with reality.
+
+        * runtime/JSImmediate.h:
+        (JSC::JSFastMath::canDoFastAdditiveOperations):
+
 2009-01-13  Zalan Bujtas  <zbujtas@gmail.com>
 
         Reviewed by Darin Adler.
index 8ba027a..05aea6f 100644 (file)
@@ -698,7 +698,7 @@ namespace JSC {
         {
             // Number is non-negative and an operation involving two of these can't overflow.
             // Checking for allowed negative numbers takes more time than it's worth on SunSpider.
-            return ((JSImmediate::rawValue(v1) | JSImmediate::rawValue(v2)) & (JSImmediate::TagTypeInteger + (JSImmediate::signBit | (JSImmediate::signBit >> 1)))) == JSImmediate::TagTypeInteger;
+            return canDoFastAdditiveOperations(v1) && canDoFastAdditiveOperations(v2);
         }
 
         static ALWAYS_INLINE JSValuePtr addImmediateNumbers(JSValuePtr v1, JSValuePtr v2)