startup-deserializer.h 1.03 KB
Newer Older
1 2 3 4 5 6 7 8
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_SNAPSHOT_STARTUP_DESERIALIZER_H_
#define V8_SNAPSHOT_STARTUP_DESERIALIZER_H_

#include "src/snapshot/deserializer.h"
9
#include "src/snapshot/snapshot-data.h"
10 11 12 13 14

namespace v8 {
namespace internal {

// Initializes an isolate with context-independent data from a given snapshot.
15
class StartupDeserializer final : public Deserializer<Isolate> {
16
 public:
17 18 19 20 21
  explicit StartupDeserializer(Isolate* isolate,
                               const SnapshotData* startup_data,
                               bool can_rehash)
      : Deserializer(isolate, startup_data->Payload(),
                     startup_data->GetMagicNumber(), false, can_rehash) {}
22 23

  // Deserialize the snapshot into an empty heap.
24
  void DeserializeIntoIsolate();
25

26
 private:
27 28
  void FlushICache();
  void LogNewMapEvents();
29 30 31 32 33 34
};

}  // namespace internal
}  // namespace v8

#endif  // V8_SNAPSHOT_STARTUP_DESERIALIZER_H_