OLD | NEW |
(Empty) | |
| 1 // 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_STARTUP_SERIALIZER_H_ |
| 6 #define V8_SNAPSHOT_STARTUP_SERIALIZER_H_ |
| 7 |
| 8 #include "src/snapshot/serializer.h" |
| 9 |
| 10 namespace v8 { |
| 11 namespace internal { |
| 12 |
| 13 class StartupSerializer : public Serializer { |
| 14 public: |
| 15 StartupSerializer(Isolate* isolate, SnapshotByteSink* sink); |
| 16 ~StartupSerializer() override; |
| 17 |
| 18 // Serialize the current state of the heap. The order is: |
| 19 // 1) Strong references. |
| 20 // 2) Partial snapshot cache. |
| 21 // 3) Weak references (e.g. the string table). |
| 22 void SerializeStrongReferences(); |
| 23 void SerializeWeakReferencesAndDeferred(); |
| 24 |
| 25 private: |
| 26 // The StartupSerializer has to serialize the root array, which is slightly |
| 27 // different. |
| 28 void VisitPointers(Object** start, Object** end) override; |
| 29 void SerializeObject(HeapObject* o, HowToCode how_to_code, |
| 30 WhereToPoint where_to_point, int skip) override; |
| 31 void Synchronize(VisitorSynchronization::SyncTag tag) override; |
| 32 |
| 33 intptr_t root_index_wave_front_; |
| 34 bool serializing_builtins_; |
| 35 DISALLOW_COPY_AND_ASSIGN(StartupSerializer); |
| 36 }; |
| 37 |
| 38 } // namespace internal |
| 39 } // namespace v8 |
| 40 |
| 41 #endif // V8_SNAPSHOT_STARTUP_SERIALIZER_H_ |
OLD | NEW |