1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_SNAPSHOT_OBJECT_DESERIALIZER_H_
6 #define V8_SNAPSHOT_OBJECT_DESERIALIZER_H_
7 
8 #include "src/snapshot/deserializer.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 class SerializedCodeData;
14 class SharedFunctionInfo;
15 
16 // Deserializes the object graph rooted at a given object.
17 class ObjectDeserializer final : public Deserializer<> {
18  public:
19   static MaybeHandle<SharedFunctionInfo> DeserializeSharedFunctionInfo(
20       Isolate* isolate, const SerializedCodeData* data, Handle<String> source);
21 
22  private:
ObjectDeserializer(const SerializedCodeData * data)23   explicit ObjectDeserializer(const SerializedCodeData* data)
24       : Deserializer(data, true) {}
25 
26   // Deserialize an object graph. Fail gracefully.
27   MaybeHandle<HeapObject> Deserialize(Isolate* isolate);
28 
29   void FlushICacheForNewCodeObjectsAndRecordEmbeddedObjects();
30   void CommitPostProcessedObjects();
31 };
32 
33 }  // namespace internal
34 }  // namespace v8
35 
36 #endif  // V8_SNAPSHOT_OBJECT_DESERIALIZER_H_
37