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

Unified Diff: src/runtime.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 3550d3bb0d72c3fe05f2c3c9504dc0da4174d885..3b9d14831ad564f3dd665f1f369c85efb7e5472c 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7414,6 +7414,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) {
}
CONVERT_DOUBLE_ARG_CHECKED(y, 1);
+ // Returning a smi would not confuse crankshaft as this part of code is only
+ // run if SSE2 was not available, in which case crankshaft is disabled.
+ if (y == 0) return Smi::FromInt(1); // Returns 1 if exponent is 0.
return isolate->heap()->AllocateHeapNumber(power_double_double(x, y));
}
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698