• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 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_READ_ONLY_DESERIALIZER_H_
6 #define V8_SNAPSHOT_READ_ONLY_DESERIALIZER_H_
7 
8 #include "src/snapshot/deserializer.h"
9 #include "src/snapshot/snapshot-data.h"
10 #include "src/snapshot/snapshot.h"
11 
12 namespace v8 {
13 namespace internal {
14 
15 // Deserializes the read-only blob, creating the read-only roots and the
16 // Read-only object cache used by the other deserializers.
17 class ReadOnlyDeserializer final : public Deserializer {
18  public:
ReadOnlyDeserializer(Isolate * isolate,const SnapshotData * data,bool can_rehash)19   explicit ReadOnlyDeserializer(Isolate* isolate, const SnapshotData* data,
20                                 bool can_rehash)
21       : Deserializer(isolate, data->Payload(), data->GetMagicNumber(), false,
22                      can_rehash) {}
23 
24   // Deserialize the snapshot into an empty heap.
25   void DeserializeIntoIsolate();
26 };
27 
28 }  // namespace internal
29 }  // namespace v8
30 
31 #endif  // V8_SNAPSHOT_READ_ONLY_DESERIALIZER_H_
32