Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index cc5aeab78f55c46446b016f848fb60c3ceadc612..7bb6f7b19aad6bef1ead31bcbcac1d0ce5fbd9a0 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -7441,9 +7441,11 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) { |
| if (y == y_int) { |
| result = power_double_int(x, y_int); // Returns 1 if exponent is 0. |
| } else if (y == 0.5) { |
| - result = (isinf(x)) ? V8_INFINITY : sqrt(x + 0.0); // Convert -0 to +0. |
| + // Convert -0 to +0. |
|
Sven Panne
2012/03/12 13:23:46
This comment refers to the last part of the ternar
|
| + result = (isinf(x)) ? V8_INFINITY : fast_sqrt(x + 0.0); |
| } else if (y == -0.5) { |
| - result = (isinf(x)) ? 0 : 1.0 / sqrt(x + 0.0); // Convert -0 to +0. |
| + // Convert -0 to +0. |
|
Sven Panne
2012/03/12 13:23:46
See above.
|
| + result = (isinf(x)) ? 0 : 1.0 / fast_sqrt(x + 0.0); |
| } else { |
| result = power_double_double(x, y); |
| } |
| @@ -7529,7 +7531,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sqrt) { |
| isolate->counters()->math_sqrt()->Increment(); |
| CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| - return isolate->heap()->AllocateHeapNumber(sqrt(x)); |
| + return isolate->heap()->AllocateHeapNumber(fast_sqrt(x)); |
| } |