diff options
author | Yang Guo <yangguo@chromium.org> | 2017-07-18 14:38:43 +0200 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-08-01 15:23:16 -0500 |
commit | 98ddab411523f83eca9b5311529f8288379e550f (patch) | |
tree | ce31c41f17f9e32036eb433043152cf247c3bd81 /deps/v8/src/heap | |
parent | a3c5ccd78ce2dbf6104f6145afd430654f125961 (diff) | |
download | android-node-v8-98ddab411523f83eca9b5311529f8288379e550f.tar.gz android-node-v8-98ddab411523f83eca9b5311529f8288379e550f.tar.bz2 android-node-v8-98ddab411523f83eca9b5311529f8288379e550f.zip |
deps: backport rehash strings after deserialization
Original commit messages:
https://github.com/v8/v8/commit/a2ab1353f6708b44d305fdd9fe65a6d29b95c6d6
[snapshot] Rehash strings after deserialization.
See https://goo.gl/6aN8xA
Bug: v8:6593
Change-Id: Ic8b0b57195d01d41591397d5d45de3f0f3ebc3d9
Reviewed-on: https://chromium-review.googlesource.com/574527
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46732}
https://github.com/v8/v8/commit/182caaf4a9b94024e47007d426831c024345cb97
Do not track transitions for built-in objects.
Objects created during bootstrapping do not need
a transition tree except for elements kind transitions.
Bug: v8:6596
Change-Id: I237b8b2792f201336e1c9731c815095dd06bc182
Reviewed-on: https://chromium-review.googlesource.com/571750
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46693}
Fixes: https://github.com/nodejs/node/issues/14171
Refs: https://github.com/nodejs/node/pull/14345
PR-URL: https://github.com/nodejs/node/pull/14004
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/heap')
-rw-r--r-- | deps/v8/src/heap/heap.cc | 17 | ||||
-rw-r--r-- | deps/v8/src/heap/heap.h | 3 |
2 files changed, 12 insertions, 8 deletions
diff --git a/deps/v8/src/heap/heap.cc b/deps/v8/src/heap/heap.cc index ad3bfef559..2b26e0d1b9 100644 --- a/deps/v8/src/heap/heap.cc +++ b/deps/v8/src/heap/heap.cc @@ -5679,14 +5679,7 @@ bool Heap::SetUp() { // Set up the seed that is used to randomize the string hash function. DCHECK(hash_seed() == 0); - if (FLAG_randomize_hashes) { - if (FLAG_hash_seed == 0) { - int rnd = isolate()->random_number_generator()->NextInt(); - set_hash_seed(Smi::FromInt(rnd & Name::kHashBitMask)); - } else { - set_hash_seed(Smi::FromInt(FLAG_hash_seed)); - } - } + if (FLAG_randomize_hashes) InitializeHashSeed(); for (int i = 0; i < static_cast<int>(v8::Isolate::kUseCounterFeatureCount); i++) { @@ -5731,6 +5724,14 @@ bool Heap::SetUp() { return true; } +void Heap::InitializeHashSeed() { + if (FLAG_hash_seed == 0) { + int rnd = isolate()->random_number_generator()->NextInt(); + set_hash_seed(Smi::FromInt(rnd & Name::kHashBitMask)); + } else { + set_hash_seed(Smi::FromInt(FLAG_hash_seed)); + } +} bool Heap::CreateHeapObjects() { // Create initial maps. diff --git a/deps/v8/src/heap/heap.h b/deps/v8/src/heap/heap.h index 80bc68c172..f18f3edd3f 100644 --- a/deps/v8/src/heap/heap.h +++ b/deps/v8/src/heap/heap.h @@ -1000,6 +1000,9 @@ class Heap { // without actually creating any objects. bool SetUp(); + // (Re-)Initialize hash seed from flag or RNG. + void InitializeHashSeed(); + // Bootstraps the object heap with the core set of objects required to run. // Returns whether it succeeded. bool CreateHeapObjects(); |