blob: 282f76e78fdb69422ba8495bfdbbbc32a6635861 [file] [log] [blame]
Ben Murdochda12d292016-06-02 14:46:10 +01001// Copyright 2016 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_PARTIAL_SERIALIZER_H_
6#define V8_SNAPSHOT_PARTIAL_SERIALIZER_H_
7
8#include "src/address-map.h"
9#include "src/snapshot/serializer.h"
10
11namespace v8 {
12namespace internal {
13
Ben Murdoch61f157c2016-09-16 13:49:30 +010014class StartupSerializer;
15
Ben Murdochda12d292016-06-02 14:46:10 +010016class PartialSerializer : public Serializer {
17 public:
Ben Murdoch61f157c2016-09-16 13:49:30 +010018 PartialSerializer(Isolate* isolate, StartupSerializer* startup_serializer);
Ben Murdochda12d292016-06-02 14:46:10 +010019
20 ~PartialSerializer() override;
21
22 // Serialize the objects reachable from a single object pointer.
23 void Serialize(Object** o);
24
25 private:
Ben Murdochda12d292016-06-02 14:46:10 +010026 void SerializeObject(HeapObject* o, HowToCode how_to_code,
27 WhereToPoint where_to_point, int skip) override;
28
Ben Murdochda12d292016-06-02 14:46:10 +010029 bool ShouldBeInThePartialSnapshotCache(HeapObject* o);
30
Ben Murdoch61f157c2016-09-16 13:49:30 +010031 StartupSerializer* startup_serializer_;
Ben Murdochda12d292016-06-02 14:46:10 +010032 DISALLOW_COPY_AND_ASSIGN(PartialSerializer);
33};
34
35} // namespace internal
36} // namespace v8
37
38#endif // V8_SNAPSHOT_PARTIAL_SERIALIZER_H_