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 if ((x == 0.0 || isinf(x)) && isfinite(y)) { | |
1158 double f; | |
1159 | |
1160 if (modf(y, &f) != 0.0) | |
1161 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 | |
1167 if (y == y_int) | |
1168 return ldexp(1.0, y); | |
alexeif
2012/04/17 16:40:13
nit: y_int
| |
1169 } | |
1170 #endif | |
1171 | |
1156 // The checks for special cases can be dropped in ia32 because it has already | 1172 // The checks for special cases can be dropped in ia32 because it has already |
1157 // been done in generated code before bailing out here. | 1173 // been done in generated code before bailing out here. |
1158 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) return OS::nan_value(); | 1174 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) return OS::nan_value(); |
1159 return pow(x, y); | 1175 return pow(x, y); |
1160 } | 1176 } |
1161 | 1177 |
1162 | 1178 |
1163 ExternalReference ExternalReference::power_double_double_function( | 1179 ExternalReference ExternalReference::power_double_double_function( |
1164 Isolate* isolate) { | 1180 Isolate* isolate) { |
1165 return ExternalReference(Redirect(isolate, | 1181 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); | 1309 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
1294 state_.written_position = state_.current_position; | 1310 state_.written_position = state_.current_position; |
1295 written = true; | 1311 written = true; |
1296 } | 1312 } |
1297 | 1313 |
1298 // Return whether something was written. | 1314 // Return whether something was written. |
1299 return written; | 1315 return written; |
1300 } | 1316 } |
1301 | 1317 |
1302 } } // namespace v8::internal | 1318 } } // namespace v8::internal |
OLD | NEW |