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

Unified Diff: src/runtime.cc

Issue 448643002: Reland "Implement trigonometric functions using a fdlibm port." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix windows build and gc mole Created 6 years, 4 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') | src/trig-table.h » ('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 5e18c97bdcf0afdcf75ced9083bc35fdbb4dd14b..cc41117ead4fd9dec1613bbf553d465ff7101e8f 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -45,6 +45,7 @@
#include "src/utils.h"
#include "src/v8threads.h"
#include "src/vm-state-inl.h"
+#include "third_party/fdlibm/fdlibm.h"
#ifdef V8_I18N_SUPPORT
#include "src/i18n.h"
@@ -7683,6 +7684,23 @@ RUNTIME_FUNCTION(Runtime_ConstructDouble) {
}
+RUNTIME_FUNCTION(Runtime_RemPiO2) {
+ HandleScope handle_scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_DOUBLE_ARG_CHECKED(x, 0);
+ Factory* factory = isolate->factory();
+ double y[2];
+ int n = rempio2(x, y);
+ Handle<FixedArray> array = factory->NewFixedArray(3);
+ Handle<HeapNumber> y0 = factory->NewHeapNumber(y[0]);
+ Handle<HeapNumber> y1 = factory->NewHeapNumber(y[1]);
+ array->set(0, Smi::FromInt(n));
+ array->set(1, *y0);
+ array->set(2, *y1);
+ return *factory->NewJSArrayWithElements(array);
+}
+
+
static const double kPiDividedBy4 = 0.78539816339744830962;
« no previous file with comments | « src/runtime.h ('k') | src/trig-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698