Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 55db916751f3c3e8e18f263f5976752c82562811..52a7d0d0b698ea745a9eafb6dea52db7d6b73d47 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" |
@@ -7676,6 +7677,21 @@ 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); |
+ array->set(0, Smi::FromInt(n)); |
+ array->set(1, *factory->NewHeapNumber(y[0])); |
+ array->set(2, *factory->NewHeapNumber(y[1])); |
+ return *factory->NewJSArrayWithElements(array); |
+} |
+ |
+ |
static const double kPiDividedBy4 = 0.78539816339744830962; |