OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/snapshot/startup-serializer.h" | 5 #include "src/snapshot/startup-serializer.h" |
6 | 6 |
7 #include "src/objects-inl.h" | 7 #include "src/objects-inl.h" |
8 #include "src/v8threads.h" | 8 #include "src/v8threads.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Object has not yet been serialized. Serialize it here. | 66 // Object has not yet been serialized. Serialize it here. |
67 ObjectSerializer object_serializer(this, obj, sink_, how_to_code, | 67 ObjectSerializer object_serializer(this, obj, sink_, how_to_code, |
68 where_to_point); | 68 where_to_point); |
69 object_serializer.Serialize(); | 69 object_serializer.Serialize(); |
70 | 70 |
71 if (serializing_immortal_immovables_roots_ && | 71 if (serializing_immortal_immovables_roots_ && |
72 root_index != RootIndexMap::kInvalidRootIndex) { | 72 root_index != RootIndexMap::kInvalidRootIndex) { |
73 // Make sure that the immortal immovable root has been included in the first | 73 // Make sure that the immortal immovable root has been included in the first |
74 // chunk of its reserved space , so that it is deserialized onto the first | 74 // chunk of its reserved space , so that it is deserialized onto the first |
75 // page of its space and stays immortal immovable. | 75 // page of its space and stays immortal immovable. |
76 BackReference ref = back_reference_map_.Lookup(obj); | 76 SerializerReference ref = reference_map_.Lookup(obj); |
77 CHECK(ref.is_valid() && ref.chunk_index() == 0); | 77 CHECK(ref.is_back_reference() && ref.chunk_index() == 0); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 void StartupSerializer::SerializeWeakReferencesAndDeferred() { | 81 void StartupSerializer::SerializeWeakReferencesAndDeferred() { |
82 // This comes right after serialization of the partial snapshot, where we | 82 // This comes right after serialization of the partial snapshot, where we |
83 // add entries to the partial snapshot cache of the startup snapshot. Add | 83 // add entries to the partial snapshot cache of the startup snapshot. Add |
84 // one entry with 'undefined' to terminate the partial snapshot cache. | 84 // one entry with 'undefined' to terminate the partial snapshot cache. |
85 Object* undefined = isolate()->heap()->undefined_value(); | 85 Object* undefined = isolate()->heap()->undefined_value(); |
86 VisitPointer(&undefined); | 86 VisitPointer(&undefined); |
87 isolate()->heap()->IterateWeakRoots(this, VISIT_ALL); | 87 isolate()->heap()->IterateWeakRoots(this, VISIT_ALL); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 if (root_index == Heap::kStackLimitRootIndex || | 158 if (root_index == Heap::kStackLimitRootIndex || |
159 root_index == Heap::kRealStackLimitRootIndex) { | 159 root_index == Heap::kRealStackLimitRootIndex) { |
160 return true; | 160 return true; |
161 } | 161 } |
162 return Heap::RootIsImmortalImmovable(root_index) != | 162 return Heap::RootIsImmortalImmovable(root_index) != |
163 serializing_immortal_immovables_roots_; | 163 serializing_immortal_immovables_roots_; |
164 } | 164 } |
165 | 165 |
166 } // namespace internal | 166 } // namespace internal |
167 } // namespace v8 | 167 } // namespace v8 |
OLD | NEW |