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

Unified Diff: src/runtime.cc

Issue 169513002: Harmony: implement Math.fround. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updated comments Created 6 years, 10 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/runtime.h ('k') | test/mjsunit/harmony/math-fround.js » ('j') | 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 3ab39abfcc7676d288c57bba9ff0d81672e6a51c..6e246b3d4765d95daf627d186db47dffbaa235bc 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7829,6 +7829,16 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sqrt) {
}
+RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_fround) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+
+ CONVERT_DOUBLE_ARG_CHECKED(x, 0);
+ float xf = static_cast<float>(x);
+ return isolate->heap()->AllocateHeapNumber(xf);
+}
+
+
RUNTIME_FUNCTION(MaybeObject*, Runtime_DateMakeDay) {
SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/harmony/math-fround.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698