[B3][Win64] Compile fixes.
authorpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jan 2016 21:43:57 +0000 (21:43 +0000)
committerpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jan 2016 21:43:57 +0000 (21:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153127

Reviewed by Alex Christensen.

MSVC have several overloads of fmod, pow, and ceil. We need to suggest to MSVC
which one we want to use.

* b3/B3LowerMacros.cpp:
* b3/B3LowerMacrosAfterOptimizations.cpp:
* b3/B3MathExtras.cpp:
(JSC::B3::powDoubleInt32):
* b3/B3ReduceStrength.cpp:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/b3/B3LowerMacros.cpp
Source/JavaScriptCore/b3/B3LowerMacrosAfterOptimizations.cpp
Source/JavaScriptCore/b3/B3MathExtras.cpp
Source/JavaScriptCore/b3/B3ReduceStrength.cpp

index 2ec8c91..990a153 100644 (file)
@@ -1,3 +1,19 @@
+2016-01-15  Per Arne Vollan  <peavo@outlook.com>
+
+        [B3][Win64] Compile fixes.
+        https://bugs.webkit.org/show_bug.cgi?id=153127
+
+        Reviewed by Alex Christensen.
+
+        MSVC have several overloads of fmod, pow, and ceil. We need to suggest to MSVC
+        which one we want to use.
+
+        * b3/B3LowerMacros.cpp:
+        * b3/B3LowerMacrosAfterOptimizations.cpp:
+        * b3/B3MathExtras.cpp:
+        (JSC::B3::powDoubleInt32):
+        * b3/B3ReduceStrength.cpp:
+
 2016-01-15  Filip Pizlo  <fpizlo@apple.com>
 
         Air needs a Shuffle instruction
index 04e7a55..f71ca62 100644 (file)
@@ -76,8 +76,9 @@ private:
             m_origin = m_value->origin();
             switch (m_value->opcode()) {
             case Mod: {
+                double (*fmodDouble)(double, double) = fmod;
                 if (m_value->type() == Double) {
-                    Value* functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, fmod);
+                    Value* functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, fmodDouble);
                     Value* result = m_insertionSet.insert<CCallValue>(m_index, Double, m_origin,
                         Effects::none(),
                         functionAddress,
@@ -88,7 +89,7 @@ private:
                 } else if (m_value->type() == Float) {
                     Value* numeratorAsDouble = m_insertionSet.insert<Value>(m_index, FloatToDouble, m_origin, m_value->child(0));
                     Value* denominatorAsDouble = m_insertionSet.insert<Value>(m_index, FloatToDouble, m_origin, m_value->child(1));
-                    Value* functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, fmod);
+                    Value* functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, fmodDouble);
                     Value* doubleMod = m_insertionSet.insert<CCallValue>(m_index, Double, m_origin,
                         Effects::none(),
                         functionAddress,
index d893cd2..b53fd6a 100644 (file)
@@ -92,8 +92,9 @@ private:
                     break;
 
                 Value* functionAddress = nullptr;
+                double (*ceilDouble)(double) = ceil;
                 if (m_value->type() == Double)
-                    functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, ceil);
+                    functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, ceilDouble);
                 else if (m_value->type() == Float)
                     functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, ceilf);
                 else
index 2756d88..65e3276 100644 (file)
@@ -58,9 +58,10 @@ std::pair<BasicBlock*, Value*> powDoubleInt32(Procedure& procedure, BasicBlock*
 
     // Function call.
     Value* yAsDouble = functionCallCase->appendNew<Value>(procedure, IToD, origin, y);
+    double (*powDouble)(double, double) = pow;
     Value* powResult = functionCallCase->appendNew<CCallValue>(
         procedure, Double, origin,
-        functionCallCase->appendNew<ConstPtrValue>(procedure, origin, bitwise_cast<void*>(pow)),
+        functionCallCase->appendNew<ConstPtrValue>(procedure, origin, bitwise_cast<void*>(powDouble)),
         x, yAsDouble);
     UpsilonValue* powResultUpsilon = functionCallCase->appendNew<UpsilonValue>(procedure, origin, powResult);
     functionCallCase->appendNew<ControlValue>(procedure, Jump, origin, FrequentedBlock(continuation));
index 697ea7f..2ccdd1d 100644 (file)
@@ -948,18 +948,19 @@ private:
             break;
         }
 
-        case CCall:
+        case CCall: {
             // Turn this: Call(fmod, constant1, constant2)
             // Into this: fcall-constant(constant1, constant2)
+            double(*fmodDouble)(double, double) = fmod;
             if (m_value->type() == Double
                 && m_value->numChildren() == 3
-                && m_value->child(0)->isIntPtr(reinterpret_cast<intptr_t>(fmod))
+                && m_value->child(0)->isIntPtr(reinterpret_cast<intptr_t>(fmodDouble))
                 && m_value->child(1)->type() == Double
                 && m_value->child(2)->type() == Double) {
                 replaceWithNewValue(m_value->child(1)->modConstant(m_proc, m_value->child(2)));
             }
             break;
-
+        }
         case Equal:
             handleCommutativity();