11cb0ef41Sopenharmony_ci// Copyright 2021 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#ifndef V8_SNAPSHOT_SHARED_HEAP_DESERIALIZER_H_
61cb0ef41Sopenharmony_ci#define V8_SNAPSHOT_SHARED_HEAP_DESERIALIZER_H_
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include "src/snapshot/deserializer.h"
91cb0ef41Sopenharmony_ci#include "src/snapshot/snapshot-data.h"
101cb0ef41Sopenharmony_ci#include "src/snapshot/snapshot.h"
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_cinamespace v8 {
131cb0ef41Sopenharmony_cinamespace internal {
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci// Initializes objects in the shared isolate that are not already included in
161cb0ef41Sopenharmony_ci// the startup snapshot.
171cb0ef41Sopenharmony_ciclass SharedHeapDeserializer final : public Deserializer<Isolate> {
181cb0ef41Sopenharmony_ci public:
191cb0ef41Sopenharmony_ci  explicit SharedHeapDeserializer(Isolate* isolate,
201cb0ef41Sopenharmony_ci                                  const SnapshotData* shared_heap_data,
211cb0ef41Sopenharmony_ci                                  bool can_rehash)
221cb0ef41Sopenharmony_ci      : Deserializer(isolate, shared_heap_data->Payload(),
231cb0ef41Sopenharmony_ci                     shared_heap_data->GetMagicNumber(), false, can_rehash) {}
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ci  // Depending on runtime flags, deserialize shared heap objects into the
261cb0ef41Sopenharmony_ci  // Isolate.
271cb0ef41Sopenharmony_ci  void DeserializeIntoIsolate();
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ci private:
301cb0ef41Sopenharmony_ci  void DeserializeStringTable();
311cb0ef41Sopenharmony_ci};
321cb0ef41Sopenharmony_ci
331cb0ef41Sopenharmony_ci}  // namespace internal
341cb0ef41Sopenharmony_ci}  // namespace v8
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ci#endif  // V8_SNAPSHOT_SHARED_HEAP_DESERIALIZER_H_
37