Index: src/crankshaft/hydrogen-instructions.cc |
diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc |
index 5d3c56d5b6f7d2232dbce9e98d85e77a13055d6c..ef50c64c4209a2b11bf05acd2fb0bdbba315c1e5 100644 |
--- a/src/crankshaft/hydrogen-instructions.cc |
+++ b/src/crankshaft/hydrogen-instructions.cc |
@@ -1115,10 +1115,14 @@ const char* HUnaryMathOperation::OpName() const { |
return "round"; |
case kMathAbs: |
return "abs"; |
+ case kMathCos: |
+ return "cos"; |
case kMathLog: |
return "log"; |
case kMathExp: |
return "exp"; |
+ case kMathSin: |
+ return "sin"; |
case kMathSqrt: |
return "sqrt"; |
case kMathPowHalf: |
@@ -3401,6 +3405,9 @@ HInstruction* HUnaryMathOperation::New(Isolate* isolate, Zone* zone, |
} |
if (std::isinf(d)) { // +Infinity and -Infinity. |
switch (op) { |
+ case kMathCos: |
+ case kMathSin: |
+ return H_CONSTANT_DOUBLE(std::numeric_limits<double>::quiet_NaN()); |
case kMathExp: |
return H_CONSTANT_DOUBLE((d > 0.0) ? d : 0.0); |
case kMathLog: |
@@ -3422,10 +3429,14 @@ HInstruction* HUnaryMathOperation::New(Isolate* isolate, Zone* zone, |
} |
} |
switch (op) { |
+ case kMathCos: |
+ return H_CONSTANT_DOUBLE(base::ieee754::cos(d)); |
case kMathExp: |
return H_CONSTANT_DOUBLE(base::ieee754::exp(d)); |
case kMathLog: |
return H_CONSTANT_DOUBLE(base::ieee754::log(d)); |
+ case kMathSin: |
+ return H_CONSTANT_DOUBLE(base::ieee754::sin(d)); |
case kMathSqrt: |
lazily_initialize_fast_sqrt(isolate); |
return H_CONSTANT_DOUBLE(fast_sqrt(d, isolate)); |