5 #ifndef V8_SNAPSHOT_DESERIALIZER_H_ 6 #define V8_SNAPSHOT_DESERIALIZER_H_ 10 #include "src/objects/code.h" 11 #include "src/objects/js-array.h" 12 #include "src/objects/map.h" 13 #include "src/objects/string.h" 14 #include "src/snapshot/deserializer-allocator.h" 15 #include "src/snapshot/serializer-common.h" 16 #include "src/snapshot/snapshot-source-sink.h" 28 #if defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64) || \ 29 defined(V8_TARGET_ARCH_PPC) || defined(V8_TARGET_ARCH_S390) || \ 30 V8_EMBEDDED_CONSTANT_POOL 31 #define V8_CODE_EMBEDS_OBJECT_POINTER 1 33 #define V8_CODE_EMBEDS_OBJECT_POINTER 0 41 void SetRehashability(
bool v) { can_rehash_ = v; }
48 source_(data->Payload()),
49 magic_number_(data->GetMagicNumber()),
50 external_reference_table_(
nullptr),
52 deserializing_user_code_(deserializing_user_code),
54 allocator()->DecodeReservation(data->Reservations());
57 off_heap_backing_stores_.push_back(
nullptr);
60 void Initialize(
Isolate* isolate);
61 void DeserializeDeferredObjects();
64 void LogNewObjectEvents();
65 void LogScriptEvents(
Script* script);
66 void LogNewMapEvents();
70 HeapObject* GetBackReferencedObject(
int space);
75 attached_objects_.push_back(attached_object);
78 Isolate* isolate()
const {
return isolate_; }
80 const std::vector<AllocationSite*>& new_allocation_sites()
const {
81 return new_allocation_sites_;
83 const std::vector<Code>& new_code_objects()
const {
84 return new_code_objects_;
86 const std::vector<Map>& new_maps()
const {
return new_maps_; }
87 const std::vector<AccessorInfo*>& accessor_infos()
const {
88 return accessor_infos_;
90 const std::vector<CallHandlerInfo*>& call_handler_infos()
const {
91 return call_handler_infos_;
93 const std::vector<Handle<String>>& new_internalized_strings()
const {
94 return new_internalized_strings_;
96 const std::vector<Handle<Script>>& new_scripts()
const {
101 bool deserializing_user_code()
const {
return deserializing_user_code_; }
102 bool can_rehash()
const {
return can_rehash_; }
110 void VisitRootPointers(Root root,
const char* description,
ObjectSlot start,
113 void Synchronize(VisitorSynchronization::SyncTag tag)
override;
128 template <
int where,
int how,
int within,
int space_number_if_any>
130 Address current_object_address, byte data,
131 bool write_barrier_needed);
139 HeapObjectReferenceType reference_type);
145 std::vector<Handle<HeapObject>> attached_objects_;
152 std::vector<Map> new_maps_;
153 std::vector<AllocationSite*> new_allocation_sites_;
154 std::vector<Code> new_code_objects_;
155 std::vector<AccessorInfo*> accessor_infos_;
156 std::vector<CallHandlerInfo*> call_handler_infos_;
157 std::vector<Handle<String>> new_internalized_strings_;
158 std::vector<Handle<Script>> new_scripts_;
159 std::vector<byte*> off_heap_backing_stores_;
162 const bool deserializing_user_code_;
166 std::vector<HeapObject*> to_rehash_;
183 bool IsMatch(
Object*
string)
override;
191 DISALLOW_HEAP_ALLOCATION(no_gc);
197 #endif // V8_SNAPSHOT_DESERIALIZER_H_