V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
read-only-serializer.h
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_SERIALIZER_H_
6 #define V8_SNAPSHOT_READ_ONLY_SERIALIZER_H_
7 
8 #include "src/snapshot/roots-serializer.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 class HeapObject;
14 class SnapshotByteSink;
15 
17  public:
18  explicit ReadOnlySerializer(Isolate* isolate);
19  ~ReadOnlySerializer() override;
20 
21  void SerializeReadOnlyRoots();
22 
23  // Completes the serialization of the read-only object cache and serializes
24  // any deferred objects.
25  void FinalizeSerialization();
26 
27  // If |obj| can be serialized in the read-only snapshot then add it to the
28  // read-only object cache if not already present and emit a
29  // ReadOnlyObjectCache bytecode into |sink|. Returns whether this was
30  // successful.
31  bool SerializeUsingReadOnlyObjectCache(SnapshotByteSink* sink,
32  HeapObject* obj, HowToCode how_to_code,
33  WhereToPoint where_to_point, int skip);
34 
35  private:
36  void SerializeObject(HeapObject* o, HowToCode how_to_code,
37  WhereToPoint where_to_point, int skip) override;
38  bool MustBeDeferred(HeapObject* object) override;
39 
40  DISALLOW_COPY_AND_ASSIGN(ReadOnlySerializer);
41 };
42 
43 } // namespace internal
44 } // namespace v8
45 
46 #endif // V8_SNAPSHOT_READ_ONLY_SERIALIZER_H_
Definition: libplatform.h:13