Chromium Code Reviews| Index: src/heap.cc |
| diff --git a/src/heap.cc b/src/heap.cc |
| index aaa3d8b60c905afa9f5736fc9c9eddd15c9244b7..577df0885f846469f28006455722dd6fd01e9919 100644 |
| --- a/src/heap.cc |
| +++ b/src/heap.cc |
| @@ -38,6 +38,7 @@ |
| #include "global-handles.h" |
| #include "heap-profiler.h" |
| #include "incremental-marking.h" |
| +#include "isolate-inl.h" |
| #include "mark-compact.h" |
| #include "natives.h" |
| #include "objects-visiting.h" |
| @@ -47,6 +48,7 @@ |
| #include "scopeinfo.h" |
| #include "snapshot.h" |
| #include "store-buffer.h" |
| +#include "utils/random-number-generator.h" |
| #include "v8threads.h" |
| #include "v8utils.h" |
| #include "vm-state-inl.h" |
| @@ -5762,7 +5764,7 @@ MaybeObject* Heap::AllocateSymbol() { |
| int hash; |
| int attempts = 0; |
| do { |
| - hash = V8::RandomPrivate(isolate()) & Name::kHashBitMask; |
| + hash = isolate()->random_number_generator()->NextInt() & Name::kHashBitMask; |
| attempts++; |
| } while (hash == 0 && attempts < 30); |
| if (hash == 0) hash = 1; // never return 0 |
| @@ -6927,8 +6929,9 @@ bool Heap::SetUp() { |
| ASSERT(hash_seed() == 0); |
| if (FLAG_randomize_hashes) { |
| if (FLAG_hash_seed == 0) { |
| - set_hash_seed( |
| - Smi::FromInt(V8::RandomPrivate(isolate()) & 0x3fffffff)); |
| + set_hash_seed(Smi::FromInt( |
| + isolate()->random_number_generator()->NextInt() & |
|
Michael Starzinger
2013/09/09 17:11:25
nit: Indentation is off.
Benedikt Meurer
2013/09/10 06:08:07
Done.
|
| + Name::kHashBitMask)); |
| } else { |
| set_hash_seed(Smi::FromInt(FLAG_hash_seed)); |
| } |