1// Copyright 2021 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_SHARED_HEAP_DESERIALIZER_H_
6#define V8_SNAPSHOT_SHARED_HEAP_DESERIALIZER_H_
7
8#include "src/snapshot/deserializer.h"
9#include "src/snapshot/snapshot-data.h"
10#include "src/snapshot/snapshot.h"
11
12namespace v8 {
13namespace internal {
14
15// Initializes objects in the shared isolate that are not already included in
16// the startup snapshot.
17class SharedHeapDeserializer final : public Deserializer<Isolate> {
18 public:
19  explicit SharedHeapDeserializer(Isolate* isolate,
20                                  const SnapshotData* shared_heap_data,
21                                  bool can_rehash)
22      : Deserializer(isolate, shared_heap_data->Payload(),
23                     shared_heap_data->GetMagicNumber(), false, can_rehash) {}
24
25  // Depending on runtime flags, deserialize shared heap objects into the
26  // Isolate.
27  void DeserializeIntoIsolate();
28
29 private:
30  void DeserializeStringTable();
31};
32
33}  // namespace internal
34}  // namespace v8
35
36#endif  // V8_SNAPSHOT_SHARED_HEAP_DESERIALIZER_H_
37