Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: src/assembler.cc

Issue 8804005: Fixing Math.pow(NaN, -0.0) == 1 on Windows. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 Sun Microsystems Inc. 1 // Copyright (c) 2011 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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 // been done in generated code before bailing out here. 1117 // been done in generated code before bailing out here.
1118 #if !defined(V8_TARGET_ARCH_IA32) 1118 #if !defined(V8_TARGET_ARCH_IA32)
1119 int y_int = static_cast<int>(y); 1119 int y_int = static_cast<int>(y);
1120 if (y == y_int) { 1120 if (y == y_int) {
1121 return power_double_int(x, y_int); // Returns 1.0 for exponent 0. 1121 return power_double_int(x, y_int); // Returns 1.0 for exponent 0.
1122 } 1122 }
1123 if (!isinf(x)) { 1123 if (!isinf(x)) {
1124 if (y == 0.5) return sqrt(x + 0.0); // -0 must be converted to +0. 1124 if (y == 0.5) return sqrt(x + 0.0); // -0 must be converted to +0.
1125 if (y == -0.5) return 1.0 / sqrt(x + 0.0); 1125 if (y == -0.5) return 1.0 / sqrt(x + 0.0);
1126 } 1126 }
1127 #else
1128 if (y == 0) return 1; // Returns 1.0 for exponent 0.
1127 #endif 1129 #endif
1128 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) { 1130 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
1129 return OS::nan_value(); 1131 return OS::nan_value();
1130 } 1132 }
1131 return pow(x, y); 1133 return pow(x, y);
1132 } 1134 }
1133 1135
1134 1136
1135 ExternalReference ExternalReference::power_double_double_function( 1137 ExternalReference ExternalReference::power_double_double_function(
1136 Isolate* isolate) { 1138 Isolate* isolate) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 1267 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
1266 state_.written_position = state_.current_position; 1268 state_.written_position = state_.current_position;
1267 written = true; 1269 written = true;
1268 } 1270 }
1269 1271
1270 // Return whether something was written. 1272 // Return whether something was written.
1271 return written; 1273 return written;
1272 } 1274 }
1273 1275
1274 } } // namespace v8::internal 1276 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698