Index: src/v8.cc |
diff --git a/src/v8.cc b/src/v8.cc |
index aebcc2f1d945104b5708673920737d6a80c8e621..ca43e166354921f47165b83750dc8e12fb1b8631 100644 |
--- a/src/v8.cc |
+++ b/src/v8.cc |
@@ -141,9 +141,10 @@ void V8::SetEntropySource(EntropySource source) { |
// Used by JavaScript APIs |
-uint32_t V8::Random(Isolate* isolate) { |
- ASSERT(isolate == Isolate::Current()); |
- return random_base(isolate->random_seed()); |
+uint32_t V8::Random(Context* context) { |
+ ASSERT(context->IsGlobalContext()); |
+ ByteArray* seed = context->random_seed(); |
+ return random_base(reinterpret_cast<uint32_t*>(seed->GetDataStartAddress())); |
} |
@@ -173,8 +174,9 @@ typedef union { |
} double_int_union; |
-Object* V8::FillHeapNumberWithRandom(Object* heap_number, Isolate* isolate) { |
- uint64_t random_bits = Random(isolate); |
+Object* V8::FillHeapNumberWithRandom(Object* heap_number, |
+ Context* context) { |
+ uint64_t random_bits = Random(context); |
// Make a double* from address (heap_number + sizeof(double)). |
double_int_union* r = reinterpret_cast<double_int_union*>( |
reinterpret_cast<char*>(heap_number) + |