summaryrefslogtreecommitdiff
path: root/deps/v8/src/runtime/runtime-maths.cc
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2016-01-20 09:45:45 -0800
committerAli Ijaz Sheikh <ofrobots@google.com>2016-01-21 16:53:58 -0800
commitef4170ea03a80b21b2d8a65ce432efaa370fe2fa (patch)
treee382b1b38b729cd8155b56b441c3a563914854a3 /deps/v8/src/runtime/runtime-maths.cc
parent5f6dfab832979999d2f806fc1a2f1c11a25b0f35 (diff)
downloadnode-new-ef4170ea03a80b21b2d8a65ce432efaa370fe2fa.tar.gz
deps: upgrade to V8 4.8.271.17
Pick up V8 4.8 branch-head. This branch brings in @@isConcatSpreadable, @@toPrimitive and ToLength ES6 changes. For full details see: http://v8project.blogspot.de/2015/11/v8-release-48.html https://github.com/v8/v8/commit/fa163e2 Ref: https://github.com/nodejs/node/pull/4399 PR-URL: https://github.com/nodejs/node/pull/4785 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/src/runtime/runtime-maths.cc')
-rw-r--r--deps/v8/src/runtime/runtime-maths.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/deps/v8/src/runtime/runtime-maths.cc b/deps/v8/src/runtime/runtime-maths.cc
index 504261679e..70c587d745 100644
--- a/deps/v8/src/runtime/runtime-maths.cc
+++ b/deps/v8/src/runtime/runtime-maths.cc
@@ -6,6 +6,7 @@
#include "src/arguments.h"
#include "src/assembler.h"
+#include "src/base/utils/random-number-generator.h"
#include "src/codegen.h"
#include "src/third_party/fdlibm/fdlibm.h"
@@ -67,8 +68,8 @@ RUNTIME_FUNCTION(Runtime_RemPiO2) {
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
CONVERT_ARG_CHECKED(JSTypedArray, result, 1);
RUNTIME_ASSERT(result->byte_length() == Smi::FromInt(2 * sizeof(double)));
- void* backing_store = JSArrayBuffer::cast(result->buffer())->backing_store();
- double* y = static_cast<double*>(backing_store);
+ FixedFloat64Array* array = FixedFloat64Array::cast(result->elements());
+ double* y = static_cast<double*>(array->DataPtr());
return Smi::FromInt(fdlibm::rempio2(x, y));
}
@@ -244,5 +245,20 @@ RUNTIME_FUNCTION(Runtime_IsMinusZero) {
HeapNumber* number = HeapNumber::cast(obj);
return isolate->heap()->ToBoolean(IsMinusZero(number->value()));
}
+
+
+RUNTIME_FUNCTION(Runtime_InitializeRNG) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 0);
+ static const int kSize = 4;
+ Handle<FixedArray> array = isolate->factory()->NewFixedArray(kSize);
+ uint16_t seeds[kSize];
+ do {
+ isolate->random_number_generator()->NextBytes(seeds,
+ kSize * sizeof(*seeds));
+ } while (!(seeds[0] && seeds[1] && seeds[2] && seeds[3]));
+ for (int i = 0; i < kSize; i++) array->set(i, Smi::FromInt(seeds[i]));
+ return *isolate->factory()->NewJSArrayWithElements(array);
+}
} // namespace internal
} // namespace v8