| Index: src/assembler.cc
|
| diff --git a/src/assembler.cc b/src/assembler.cc
|
| index b4958f5b392dc798e6fdd07c09818acc7b7c1371..d0beab5f1480ada38a20102eaed2ed8e0b685c78 100644
|
| --- a/src/assembler.cc
|
| +++ b/src/assembler.cc
|
| @@ -1383,6 +1383,21 @@ ExternalReference ExternalReference::ForDeoptEntry(Address entry) {
|
| }
|
|
|
|
|
| +double power_helper(double x, double y) {
|
| + int y_int = static_cast<int>(y);
|
| + if (y == y_int) {
|
| + return power_double_int(x, y_int); // Returns 1 if exponent is 0.
|
| + }
|
| + if (y == 0.5) {
|
| + return (isinf(x)) ? V8_INFINITY : fast_sqrt(x + 0.0); // Convert -0 to +0.
|
| + }
|
| + if (y == -0.5) {
|
| + return (isinf(x)) ? 0 : 1.0 / fast_sqrt(x + 0.0); // Convert -0 to +0.
|
| + }
|
| + return power_double_double(x, y);
|
| +}
|
| +
|
| +
|
| // Helper function to compute x^y, where y is known to be an
|
| // integer. Uses binary decomposition to limit the number of
|
| // multiplications; see the discussion in "Hacker's Delight" by Henry
|
|
|