Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: src/snapshot/deserializer.h

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef V8_SNAPSHOT_DESERIALIZER_H_ 5 #ifndef V8_SNAPSHOT_DESERIALIZER_H_
6 #define V8_SNAPSHOT_DESERIALIZER_H_ 6 #define V8_SNAPSHOT_DESERIALIZER_H_
7 7
8 #include "src/heap/heap.h" 8 #include "src/heap/heap.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 #include "src/snapshot/serializer-common.h" 10 #include "src/snapshot/serializer-common.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Deserialize an object graph. Fail gracefully. 56 // Deserialize an object graph. Fail gracefully.
57 MaybeHandle<HeapObject> DeserializeObject(Isolate* isolate); 57 MaybeHandle<HeapObject> DeserializeObject(Isolate* isolate);
58 58
59 // Add an object to back an attached reference. The order to add objects must 59 // Add an object to back an attached reference. The order to add objects must
60 // mirror the order they are added in the serializer. 60 // mirror the order they are added in the serializer.
61 void AddAttachedObject(Handle<HeapObject> attached_object) { 61 void AddAttachedObject(Handle<HeapObject> attached_object) {
62 attached_objects_.Add(attached_object); 62 attached_objects_.Add(attached_object);
63 } 63 }
64 64
65 private: 65 private:
66 void VisitPointers(Object** start, Object** end) override; 66 void VisitRootPointers(Root root, Object** start, Object** end) override;
67 67
68 void Synchronize(VisitorSynchronization::SyncTag tag) override; 68 void Synchronize(VisitorSynchronization::SyncTag tag) override;
69 69
70 void VisitRuntimeEntry(RelocInfo* rinfo) override { UNREACHABLE(); }
71
72 void Initialize(Isolate* isolate); 70 void Initialize(Isolate* isolate);
73 71
74 bool deserializing_user_code() { return deserializing_user_code_; } 72 bool deserializing_user_code() { return deserializing_user_code_; }
75 73
76 void DecodeReservation(Vector<const SerializedData::Reservation> res); 74 void DecodeReservation(Vector<const SerializedData::Reservation> res);
77 75
78 bool ReserveSpace(); 76 bool ReserveSpace();
79 77
80 void UnalignedCopy(Object** dest, Object** src) { 78 void UnalignedCopy(Object** dest, Object** src) {
81 memcpy(dest, src, sizeof(*src)); 79 memcpy(dest, src, sizeof(*src));
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 150
153 AllocationAlignment next_alignment_; 151 AllocationAlignment next_alignment_;
154 152
155 DISALLOW_COPY_AND_ASSIGN(Deserializer); 153 DISALLOW_COPY_AND_ASSIGN(Deserializer);
156 }; 154 };
157 155
158 } // namespace internal 156 } // namespace internal
159 } // namespace v8 157 } // namespace v8
160 158
161 #endif // V8_SNAPSHOT_DESERIALIZER_H_ 159 #endif // V8_SNAPSHOT_DESERIALIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698