Title: [167382] trunk/Source/_javascript_Core
Revision
167382
Author
commit-qu...@webkit.org
Date
2014-04-16 13:54:43 -0700 (Wed, 16 Apr 2014)

Log Message

Fix JSC Debug Regressions on Windows
https://bugs.webkit.org/show_bug.cgi?id=131182

Patch by pe...@outlook.com <pe...@outlook.com> on 2014-04-16
Reviewed by Brent Fulgham.

The cast static_cast<int64_t>(number) in JSValue::isMachineInt() can generate a floating point error,
and set the st floating point register tags, if the value of the number parameter is infinite.
If the st floating point register tags are not cleared, this can cause strange floating point behavior later on.
This can be avoided by checking for infinity first.

* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isMachineInt): Avoid floating point error by checking for infinity first.
* runtime/Options.cpp:
(JSC::recomputeDependentOptions): Re-enable jit for Windows.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (167381 => 167382)


--- trunk/Source/_javascript_Core/ChangeLog	2014-04-16 20:43:12 UTC (rev 167381)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-04-16 20:54:43 UTC (rev 167382)
@@ -1,3 +1,20 @@
+2014-04-16  pe...@outlook.com  <pe...@outlook.com>
+
+        Fix JSC Debug Regressions on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=131182
+
+        Reviewed by Brent Fulgham.
+
+        The cast static_cast<int64_t>(number) in JSValue::isMachineInt() can generate a floating point error,
+        and set the st floating point register tags, if the value of the number parameter is infinite.
+        If the st floating point register tags are not cleared, this can cause strange floating point behavior later on.
+        This can be avoided by checking for infinity first.
+
+        * runtime/JSCJSValueInlines.h:
+        (JSC::JSValue::isMachineInt): Avoid floating point error by checking for infinity first.
+        * runtime/Options.cpp:
+        (JSC::recomputeDependentOptions): Re-enable jit for Windows.
+
 2014-04-16  Oliver Hunt  <oli...@apple.com>
 
         Simple ES6 feature:Array.prototype.fill

Modified: trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h (167381 => 167382)


--- trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h	2014-04-16 20:43:12 UTC (rev 167381)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h	2014-04-16 20:54:43 UTC (rev 167382)
@@ -504,6 +504,11 @@
     double number = asDouble();
     if (number != number)
         return false;
+#if OS(WINDOWS)
+    // Need to check for infinity on Windows to avoid floating point error on following cast, see bug 131182.
+    if (std::isinf(number))
+        return false;
+#endif
     int64_t asInt64 = static_cast<int64_t>(number);
     if (asInt64 != number)
         return false;

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (167381 => 167382)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2014-04-16 20:43:12 UTC (rev 167381)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2014-04-16 20:54:43 UTC (rev 167382)
@@ -226,11 +226,6 @@
 #if !ENABLE(FTL_JIT)
     Options::useFTLJIT() = false;
 #endif
-#if OS(WINDOWS)
-    // Temporarily disable the JIT on Windows until we have a fix for
-    // https://webkit.org/b/131182.
-    Options::useJIT() = false;
-#endif
 
     if (Options::showDisassembly()
         || Options::showDFGDisassembly()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to