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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 m *= m; | 1146 m *= m; |
1147 if ((n & 2) != 0) p *= m; | 1147 if ((n & 2) != 0) p *= m; |
1148 m *= m; | 1148 m *= m; |
1149 n >>= 2; | 1149 n >>= 2; |
1150 } | 1150 } |
1151 return p; | 1151 return p; |
1152 } | 1152 } |
1153 | 1153 |
1154 | 1154 |
1155 double power_double_double(double x, double y) { | 1155 double power_double_double(double x, double y) { |
| 1156 #ifdef __MINGW64_VERSION_MAJOR |
| 1157 // MinGW64 has a custom implementation for pow. This handles certain |
| 1158 // special cases that are different. |
| 1159 if ((x == 0.0 || isinf(x)) && isfinite(y)) { |
| 1160 double f; |
| 1161 if (modf(y, &f) != 0.0) return ((x == 0.0) ^ (y > 0)) ? V8_INFINITY : 0; |
| 1162 } |
| 1163 |
| 1164 if (x == 2.0) { |
| 1165 int y_int = static_cast<int>(y); |
| 1166 if (y == y_int) return ldexp(1.0, y); |
| 1167 } |
| 1168 #endif |
| 1169 |
1156 // The checks for special cases can be dropped in ia32 because it has already | 1170 // The checks for special cases can be dropped in ia32 because it has already |
1157 // been done in generated code before bailing out here. | 1171 // been done in generated code before bailing out here. |
1158 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) return OS::nan_value(); | 1172 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) return OS::nan_value(); |
1159 return pow(x, y); | 1173 return pow(x, y); |
1160 } | 1174 } |
1161 | 1175 |
1162 | 1176 |
1163 ExternalReference ExternalReference::power_double_double_function( | 1177 ExternalReference ExternalReference::power_double_double_function( |
1164 Isolate* isolate) { | 1178 Isolate* isolate) { |
1165 return ExternalReference(Redirect(isolate, | 1179 return ExternalReference(Redirect(isolate, |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1307 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
1294 state_.written_position = state_.current_position; | 1308 state_.written_position = state_.current_position; |
1295 written = true; | 1309 written = true; |
1296 } | 1310 } |
1297 | 1311 |
1298 // Return whether something was written. | 1312 // Return whether something was written. |
1299 return written; | 1313 return written; |
1300 } | 1314 } |
1301 | 1315 |
1302 } } // namespace v8::internal | 1316 } } // namespace v8::internal |
OLD | NEW |