| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 return p; | 831 return p; |
| 832 } | 832 } |
| 833 | 833 |
| 834 | 834 |
| 835 double power_double_double(double x, double y) { | 835 double power_double_double(double x, double y) { |
| 836 int y_int = static_cast<int>(y); | 836 int y_int = static_cast<int>(y); |
| 837 if (y == y_int) { | 837 if (y == y_int) { |
| 838 return power_double_int(x, y_int); // Returns 1.0 for exponent 0. | 838 return power_double_int(x, y_int); // Returns 1.0 for exponent 0. |
| 839 } | 839 } |
| 840 if (!isinf(x)) { | 840 if (!isinf(x)) { |
| 841 if (y == 0.5) return sqrt(x); | 841 if (y == 0.5) return sqrt(x + 0.0); // -0 must be converted to +0. |
| 842 if (y == -0.5) return 1.0 / sqrt(x); | 842 if (y == -0.5) return 1.0 / sqrt(x + 0.0); |
| 843 } | 843 } |
| 844 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) { | 844 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) { |
| 845 return OS::nan_value(); | 845 return OS::nan_value(); |
| 846 } | 846 } |
| 847 return pow(x, y); | 847 return pow(x, y); |
| 848 } | 848 } |
| 849 | 849 |
| 850 | 850 |
| 851 ExternalReference ExternalReference::power_double_double_function() { | 851 ExternalReference ExternalReference::power_double_double_function() { |
| 852 return ExternalReference(Redirect(FUNCTION_ADDR(power_double_double))); | 852 return ExternalReference(Redirect(FUNCTION_ADDR(power_double_double))); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 958 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
| 959 state_.written_position = state_.current_position; | 959 state_.written_position = state_.current_position; |
| 960 written = true; | 960 written = true; |
| 961 } | 961 } |
| 962 | 962 |
| 963 // Return whether something was written. | 963 // Return whether something was written. |
| 964 return written; | 964 return written; |
| 965 } | 965 } |
| 966 | 966 |
| 967 } } // namespace v8::internal | 967 } } // namespace v8::internal |
| OLD | NEW |