summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/MathObject.cpp
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-01-09 09:47:50 +0100
committerSergio Ahumada <sergio.ahumada@digia.com>2013-01-09 09:48:18 +0100
commit061addcfbbedeeb93079502220c15184d1da130e (patch)
tree8ea9d94e44988bdf77db3f64f5fb6563520b1ae3 /Source/JavaScriptCore/runtime/MathObject.cpp
parent15b42dc09e6e4c2957b86fb36b6dae2ef60a7698 (diff)
parent9b144019dd99d696f1a9eb9cde6afa0f04d7dc05 (diff)
downloadqtwebkit-061addcfbbedeeb93079502220c15184d1da130e.tar.gz
Merge branch 'stable' into release
Change-Id: Ifdbfff78833ca658ad6d10dd829289fc0a430e6d
Diffstat (limited to 'Source/JavaScriptCore/runtime/MathObject.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/MathObject.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/runtime/MathObject.cpp b/Source/JavaScriptCore/runtime/MathObject.cpp
index 7634487ad..f939b8dd4 100644
--- a/Source/JavaScriptCore/runtime/MathObject.cpp
+++ b/Source/JavaScriptCore/runtime/MathObject.cpp
@@ -232,6 +232,22 @@ static ALWAYS_INLINE double mathPow(double x, double y)
ALWAYS_INLINE double mathPow(double x, double y)
{
+#if COMPILER(MINGW64)
+ // MinGW-w64 has a custom implementation for pow.
+ // This handles certain special cases that are different.
+ if ((x == 0.0 || isinf(x)) && isfinite(y)) {
+ double f;
+ if (modf(y, &f) != 0.0)
+ return ((x == 0.0) ^ (y > 0.0)) ? std::numeric_limits<double>::infinity() : 0.0;
+ }
+
+ if (x == 2.0) {
+ int yInt = static_cast<int>(y);
+ if (y == yInt)
+ return ldexp(1.0, yInt);
+ }
+#endif
+
return pow(x, y);
}