Chromium Code Reviews| Index: src/snapshot/serialize.cc |
| diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc |
| index 096576f0a0e913b7aff318a6bb576bf6e7397779..5ba355470c08c31d248b16431bb64cb2f68f5b92 100644 |
| --- a/src/snapshot/serialize.cc |
| +++ b/src/snapshot/serialize.cc |
| @@ -1715,12 +1715,16 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
| } |
| int root_index = root_index_map_.Lookup(obj); |
| + bool is_immortal_immovable_root = false; |
| // We can only encode roots as such if it has already been serialized. |
| // That applies to root indices below the wave front. |
| - if (root_index != RootIndexMap::kInvalidRootIndex && |
| - root_index < root_index_wave_front_) { |
| - PutRoot(root_index, obj, how_to_code, where_to_point, skip); |
| - return; |
| + if (root_index != RootIndexMap::kInvalidRootIndex) { |
| + if (root_index < root_index_wave_front_) { |
| + PutRoot(root_index, obj, how_to_code, where_to_point, skip); |
| + return; |
| + } else { |
| + is_immortal_immovable_root = Heap::RootIsImmortalImmovable(root_index); |
| + } |
| } |
| if (SerializeKnownObject(obj, how_to_code, where_to_point, skip)) return; |
| @@ -1731,6 +1735,14 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
| ObjectSerializer object_serializer(this, obj, sink_, how_to_code, |
| where_to_point); |
| object_serializer.Serialize(); |
| + |
| + if (is_immortal_immovable_root) { |
| + // Make sure that the immortal immovable root has been included in the first |
| + // chunk of its reserved space , so that it is deserialized onto the first |
|
Michael Starzinger
2016/02/05 14:47:59
nit: Spurious white-space before comma.
|
| + // page of its space and stays immortal immovable. |
| + BackReference ref = back_reference_map_.Lookup(obj); |
| + CHECK(ref.is_valid() && ref.chunk_index() == 0); |
| + } |
| } |