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

Unified Diff: src/runtime.cc

Issue 1694004: Simplify double to number convertion. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 months 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/heap.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
===================================================================
--- src/runtime.cc (revision 4544)
+++ src/runtime.cc (working copy)
@@ -5412,7 +5412,7 @@
CONVERT_DOUBLE_CHECKED(x, args[0]);
CONVERT_DOUBLE_CHECKED(y, args[1]);
- return Heap::NewNumberFromDouble(x / y);
+ return Heap::NumberFromDouble(x / y);
}
@@ -5424,8 +5424,8 @@
CONVERT_DOUBLE_CHECKED(y, args[1]);
x = modulo(x, y);
- // NewNumberFromDouble may return a Smi instead of a Number object
- return Heap::NewNumberFromDouble(x);
+ // NumberFromDouble may return a Smi instead of a Number object
+ return Heap::NumberFromDouble(x);
}
@@ -6079,7 +6079,8 @@
if (sign && value >= -0.5) return Heap::minus_zero_value();
- return Heap::NumberFromDouble(floor(value + 0.5));
+ // Do not call NumberFromDouble() to avoid extra checks.
+ return Heap::AllocateHeapNumber(floor(value + 0.5));
}
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698