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

Side by Side Diff: src/assembler.cc

Issue 8817015: Remove early NaN/Infinity check in MathPowStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: switch -0.5 and +0.5 checks 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 | src/ia32/code-stubs-ia32.cc » ('j') | 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.0; // Returns 1.0 for exponent 0.
1129 #endif 1127 #endif
1130 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) { 1128 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
1131 return OS::nan_value(); 1129 return OS::nan_value();
1132 } 1130 }
1133 return pow(x, y); 1131 return pow(x, y);
1134 } 1132 }
1135 1133
1136 1134
1137 ExternalReference ExternalReference::power_double_double_function( 1135 ExternalReference ExternalReference::power_double_double_function(
1138 Isolate* isolate) { 1136 Isolate* isolate) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 1265 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
1268 state_.written_position = state_.current_position; 1266 state_.written_position = state_.current_position;
1269 written = true; 1267 written = true;
1270 } 1268 }
1271 1269
1272 // Return whether something was written. 1270 // Return whether something was written.
1273 return written; 1271 return written;
1274 } 1272 }
1275 1273
1276 } } // namespace v8::internal 1274 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698