Title: [115523] trunk/Source/_javascript_Core
Revision
115523
Author
[email protected]
Date
2012-04-27 18:02:03 -0700 (Fri, 27 Apr 2012)

Log Message

<rdar://problem/7909395> Math in _javascript_ is inaccurate on iOS

By defalut IEEE754 denormal support is disabled on iOS;
turn it on.

Reviewed by Filip Pizlo.

* jsc.cpp:
(main):
    - clear the appropriate bit in the fpscr.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (115522 => 115523)


--- trunk/Source/_javascript_Core/ChangeLog	2012-04-28 01:00:47 UTC (rev 115522)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-04-28 01:02:03 UTC (rev 115523)
@@ -1,3 +1,16 @@
+2012-04-27  Gavin Barraclough  <[email protected]>
+
+        <rdar://problem/7909395> Math in _javascript_ is inaccurate on iOS
+
+        By defalut IEEE754 denormal support is disabled on iOS;
+        turn it on.
+
+        Reviewed by Filip Pizlo.
+
+        * jsc.cpp:
+        (main):
+            - clear the appropriate bit in the fpscr.
+
 2012-04-27  Michael Saboff  <[email protected]>
 
         Memory wasted in JSString for non-rope strings

Modified: trunk/Source/_javascript_Core/jsc.cpp (115522 => 115523)


--- trunk/Source/_javascript_Core/jsc.cpp	2012-04-28 01:00:47 UTC (rev 115522)
+++ trunk/Source/_javascript_Core/jsc.cpp	2012-04-28 01:02:03 UTC (rev 115523)
@@ -72,6 +72,11 @@
 #include <QDateTime>
 #endif
 
+#if PLATFORM(IOS)
+#include <fenv.h>
+#include <arm/arch.h>
+#endif
+
 using namespace JSC;
 using namespace WTF;
 
@@ -445,6 +450,14 @@
 
 int main(int argc, char** argv)
 {
+#if PLATFORM(IOS)
+    // Enabled IEEE754 denormal support.
+    fenv_t env;
+    fegetenv( &env );
+    env.__fpscr &= ~0x01000000u;
+    fesetenv( &env );
+#endif
+
 #if OS(WINDOWS)
 #if !OS(WINCE)
     // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to